-
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
Fix update rawextension decoding #14764
Conversation
So from what I have gathered the issue is that if d, ok := obj.(runtime.NestedObjectDecoder); ok {
if err := d.DecodeNestedObjects(DirectDecoder{c.decoder}); err != nil {
return nil, gvk, err
}
} The outer object is decoded and converted into the GVK of obj, gvk, err := c.decoder.Decode(data, defaultGVK, into)
if err != nil {
return nil, gvk, err
}
if err := c.convertor.Convert(obj, into, c.decodeVersion); err != nil {
return nil, gvk, err
} After fixing the compile error in this PR, the update works as expected, though I did see some weird logs:
|
@@ -816,7 +816,8 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType | |||
defaultGVK := scope.Kind | |||
original := r.New() | |||
trace.Step("About to convert to expected version") | |||
obj, gvk, err := scope.Serializer.DecoderToVersion(s.Serializer, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, original) | |||
decoder := scope.Serializer.DecoderToVersion(s.Serializer, schema.GroupVersion{Group: defaultGVK.Group, Version: runtime.APIVersionInternal}) |
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 the backwards compatible change I expected
LGTM, I assume we want this upstream this as well? |
@enj the issue you are seeing is in the streamwatcher. It isn't related to this change, but we'll need to figure out what is going wrong with that area as well, as that can affect other watchers of items containing raw extensions. |
[test] |
Evaluated for origin test up to a6c9c12 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2442/) (Base Commit: df9c0ed) (PR Branch Commit: a6c9c12) |
upstream has LGTM |
Evaluated for origin merge up to a6c9c12 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1079/) (Base Commit: 857cfa5) (PR Branch Commit: a6c9c12) (Extended Tests: blocker) (Image: devenv-rhel7_6392) |
We're seeing weird things decoding update requests containing raw extensions... they're not getting converted to the internal version of the runtime object.
xref #14743