Repository navigation
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: |
| 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.
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