kubernetes-client
kubernetes-client copied to clipboard
Add support for partial object metadata
Description
The Kubernetes API supports HTTP requests that reply with a partial representation of an object.
See:
- https://github.com/kubernetes/website/issues/37448
- https://github.com/kubernetes/kubernetes/commit/33a3e325f754d179b25558dee116fca1c67d353a
- https://kubernetes.slack.com/?redir=%2Farchives%2FC0EG7JC6T%2Fp1666449343298609%3Fthread_ts%3D1666448393.697149%26cid%3DC0EG7JC6T%26name%3DC0EG7JC6T%26perma%3D1666449343298609
In order to achieve this purpose, the user can provide a specially crafted accept
HTTP header for resource requests:
accept: application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1
And for list requests too:
accept: application/json;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1
AFAIU this will return the resources with just the metadata field, omitting spec and status. I'm not sure if the list can be further customized.
A DSL method partialObjectMetadata
could be added so that we can set this in the context and then execute the requests with the modified accept header.
hey @manusa can you elaborate about the issue in brief?
hey @manusa can you elaborate about the issue in brief?
Provide a DSL method (and implementation) to be able to leverage this Kubernetes feature.
I'm not sure if you're asking because you're looking to contribute to the project and trying to find a help-wanted/good-first-issue. If this is the case, then this is not it.
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!