Skip to content

Utilize HasSpec and HasObject traits for api methods #295

@clux

Description

@clux

From a scan of k8s-openapi it does appear that it's only the Object<P, U> types, i.e. objects that look like:

  • typemeta (kind + apiVersion)
  • metadata
  • spec
  • status

That actually support the status subresource methods.

If we had a trait for "implements the spec and status model", then we might be able to implement it more accurately in subresource.rs and actually constrain the type definition for what goes in and comes out of the api methods there.

    pub async fn replace_status(&self, name: &str, pp: &PostParams, data: Vec<u8>) -> Result<K> {
        let req = self.resource.replace_status(name, &pp, data)?;
        self.client.request::<K>(req).await
    }

currently they are awkwardly all handling bytes as input.
..but then again, people will want to use server side apply on pretty much everything here anyway, so maybe it's not worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiApi abstraction relatedblockedawaiting upstream work

    Type

    No type

    Projects

    Status

    Defining

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions