kube
kube copied to clipboard
client: Metadata-only API
client-go supports operations that only interact with resource metadata via the PartialObjectMetadata type. This can allow controllers to substantially reduce I/O and memory requirements when they don't actually need an object's spec or status.
We should extend the Api type with something like:
async fn get_metadata(name: &str) -> Result<ObjectMeta>async fn list_metadata(lp: &ListParams) -> Result<ObjectList<ObjectMeta>>async fn patch_metadata(name: &str, pp: &PatchParams, patch: &Patch<P>) -> Result<ObjectMeta>async fn watch_metadata(lp: &ListParams, version: &str) -> Result<impl Stream<Item = Result<WatchEvent<ObjectMeta>>>>
These signatures may not be 100% correct--please update as needed to reflect the actual API semantics.
Discussed in https://github.com/kube-rs/kube/discussions/1023
That seems nice, but hot damn I wish this was documented somewhere.
Hey folks :) Has anyone started working on this? I'd like to take it up. I can at the very least start looking a little bit into the requirements, report back here, and get the ball rolling on a conversation around the changes necessary. Lmk :)
Hey @mateiidavid ! We have not started looking at this yet, so if you have time to look at getting the base functionality of this working, then that would indeed be very helpful!
I expect this can follow the same flow as the rest of the request flow initially:
- base
Requestimpls in (probably)kube-core/src/request.rs(with some special care to handle the extended accept header) Apiimpls inkube-client/src/api(maybe core_methods file)
and have some kind of base integration tests for some type for at least get/list/patch, and some Request level unit tests in kube-core. But I have not dug too deep into this.
Thanks @clux, that's a lot to get me going. Will try to give periodic updates :)