Repository metrics
- Stars
- (122,268 stars)
- PR merge metrics
- (Avg merge 28d 17h) (343 merged PRs in 30d)
Description
What would you like to be added: When using a typed client, decoding to a versioned struct (not an internal API type), the apiVersion/kind information returned from the server should not be dropped.
Why is this needed:
The GroupVersionKind() method included in the ObjectKind interface is largely useless when dealing with arbitrary runtime.Object instances, since typed instances drop this information here:
This is the decoder used when a client requests a decoder that does not do conversion:
I could see clearing group/version/kind information when converting to an internal version, but I don't see the benefit of stripping it on decode if we're only dealing with a versioned struct.
/sig api-machinery /cc @smarterclayton
Note that https://github.com/kubernetes/kubernetes/issues/3030 still needs to be resolved before apiVersion/kind could be depended on for individual objects for all API responses, but this would at least solve the issue with an update of an object clearing the apiVersion/kind in an update response (xref https://github.com/kubernetes-sigs/controller-runtime/issues/526)