Skip to content

CRD can't use on k8s_openapi::List, when it not trait. #74

@j13tw

Description

@j13tw

Hi All,
I think this is a issue of listed all Objects in a CRD
Like the output of kubectl get <CRD> -o json shows
kopium provides CRD conversion Struct provides k8s_openapi for use
But when the items of k8s_openapi::List::default() map the CRD output will got some issue

The expected output behavior should be something like

It will appear the trait ``ListableResource`` is not implemented for <CRD-Name>

image

In my solution is following information needs to be added to achieve List output

According to k8s_openapi's impl / trait operations
https://docs.rs/k8s-openapi/latest/k8s_openapi/struct.List.html
https://docs.rs/k8s-openapi/latest/k8s_openapi/trait.ListableResource.html
https://docs.rs/k8s-openapi/latest/k8s_openapi/trait.Resource.html

  • impl the ListableResource && Resource

Resource Info is Mapping to Your CRD

image

  • Add the derive Attribute on CRD Struct

image

For this Issue, Does anyone have a better solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions