Skip to content

Commit

Permalink
Merge pull request #18532 from bparees/ist_defaulting
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 18587, 18296, 18667, 18665, 18532).

explicitly prohibit updates to imagestream tags that are not spec tags

fixes #18519
  • Loading branch information
openshift-merge-robot authored Mar 7, 2018
2 parents faca6b6 + 4619b6c commit c1befdd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/image/registry/imagestreamtag/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ func (r *REST) Update(ctx apirequest.Context, tagName string, objInfo rest.Updat
imageStream.Spec.Tags = map[string]imageapi.TagReference{}
}
tagRef, exists := imageStream.Spec.Tags[tag]

if !exists && istag.Tag == nil {
return nil, false, kapierrors.NewBadRequest(fmt.Sprintf("imagestreamtag %s is not a spec tag in imagestream %s/%s, cannot be updated", tag, imageStream.Namespace, imageStream.Name))
}

// if the caller set tag, override the spec tag
if istag.Tag != nil {
tagRef = *istag.Tag
Expand Down

0 comments on commit c1befdd

Please sign in to comment.