Skip to content

Commit c1befdd

Browse files
Merge pull request #18532 from bparees/ist_defaulting
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
2 parents faca6b6 + 4619b6c commit c1befdd

File tree

1 file changed

+5
-0
lines changed
  • pkg/image/registry/imagestreamtag

1 file changed

+5
-0
lines changed

pkg/image/registry/imagestreamtag/rest.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ func (r *REST) Update(ctx apirequest.Context, tagName string, objInfo rest.Updat
263263
imageStream.Spec.Tags = map[string]imageapi.TagReference{}
264264
}
265265
tagRef, exists := imageStream.Spec.Tags[tag]
266+
267+
if !exists && istag.Tag == nil {
268+
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))
269+
}
270+
266271
// if the caller set tag, override the spec tag
267272
if istag.Tag != nil {
268273
tagRef = *istag.Tag

0 commit comments

Comments
 (0)