Skip to content

Api<PartialObjectMeta<K>> should opportunistically degrade to metadata requests #1614

@nightkr

Description

@nightkr

Would you like to work on this feature?

None

What problem are you trying to solve?

Currently we have two APIs for querying metadata:

  1. Api<K>::get_metadata (and co)
  2. Api<PartialObjectMeta<K>>::get (and co)

Currently, 1 requests that the K8s API only sends the metadata, while 2 requests the whole object and then discards everything else during deserialization. This requires every API to have separate variants to handle metadata-only requests efficiently (and not all of them have that path, like https://docs.rs/kube/latest/kube/runtime/struct.Controller.html#method.watches).

Describe the solution you'd like

Api::get (and co) should recognize metadata-only types, and automatically switch to the fast path.

Describe alternatives you've considered

We could continue threading both variants through all APIs that take an Api.

Documentation, Adoption, Migration Strategy

This should be transparent for end users: if you use the existing API then things just get more efficient.

Target crate for feature

kube-client

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiApi abstraction relatedcoregeneric apimachinery style workruntimecontroller runtime related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions