-
Notifications
You must be signed in to change notification settings - Fork 545
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
[Question] How to decode a RawExtension ? #102
Comments
I've stumbled on this issue as well and tried to look a bit around. I found out that this project is using RawExtension with the help of this issue (while the issue itself is not directly related to RawExtension itself, but was helpful to dig trough the source code)
I just can't say if this is the right official way, but I hope I could help you. |
I've found that kube-scheduler use RawExtension for PluginConfig: https://github.com/kubernetes/kube-scheduler/blob/master/config/v1beta1/types.go#L225, and it use DecodeNestedObjects interface which I'm not familiar with. When kube-scheduler start, it will read a json file, code is here: https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-scheduler/app/options/configfile.go#L40 , it also use |
Kubernetes admission review also uses the type { Raw []byte 'json:"-" Which A.T. golang official doc, will just ignore the Raw and Object fields during unmarshal (beacause of a hyphon in the tag), inspite of populating them. Cant understand why during unmarshal, "Raw" field is populated. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@sTb1337: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I have a hard time understanding how decoding a
RawExtension
into anObject
.Given the comment below:
apimachinery/pkg/runtime/types.go
Lines 49 to 102 in 829ed19
Especially this part:
I fail to find anything useful in
pkg/conversion
that could help me in converting theRawExtension
into anObject
. All i can think of is something like this:Has someone any advice on the correct approach to use here ?
The text was updated successfully, but these errors were encountered: