Skip to content

Commit

Permalink
explicitly reject updates to non-spec imagestreamtags
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees committed Feb 14, 2018
1 parent 4957392 commit be881c9
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 {
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 be881c9

Please sign in to comment.