-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageStreamTag update should ignore missing labels #15098
Conversation
When we started returning labels for image stream tags, old clients that retrieved the tag and updated the field were broken if the image stream had tags, since they would send empty labels (not having received them via the API) on update, and labels are immutable. This preserves the legacy behavior by defaulting the user provided image stream tag labels to the image stream labels if no labels are set in the image stream tag.
Supersedes #14803 |
@@ -219,6 +219,12 @@ func (r *REST) Update(ctx apirequest.Context, tagName string, objInfo rest.Updat | |||
return nil, false, kapierrors.NewConflict(imageapi.Resource("imagestreamtags"), istag.Name, fmt.Errorf("another caller has updated the resource version to %s", imageStream.ResourceVersion)) | |||
} | |||
|
|||
// When we began returning image stream labels in 3.6, old clients that didn't need to send labels would be | |||
// broken on update. Explicitly default labels if they are unset. We don't support mutation of labels on update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ensured by a validator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, old clients were getting immutable errors (because they previously did not need to send labels even if the image stream had them).
One question. if it is ensured, then lgtm |
[test] |
Evaluated for origin test up to 0c65fbb |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/3026/) (Base Commit: 5c7eff8) (PR Branch Commit: 0c65fbb) |
Flake on networking setup, merge |
When we started returning labels for image stream tags in 3.6, old clients that
retrieved the tag and updated the field were broken if the image stream
had tags, since they would send empty labels (not having received them
via the API) on update, and labels are immutable.
This preserves the legacy behavior by defaulting the user provided image
stream tag labels to the image stream labels if no labels are set in the
image stream tag.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1463890
[test] @mfojtik @deads2k