-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRD can't use on k8s_openapi::List, when it not trait. #74
Comments
I think that's probably the current minimal if you want to use The use kube::{Api, Client, ResourceExt};
use crate::generated::VirtualService;
let client = Client::try_default().await?;
let api: Api<VirtualService> = Api::default_namespaced(client);
for vs in api.list(&Default::default()).await? {
println!("virtualservice: {}", vs.name());
} it's mostly incidental that it provides any k8s-openapi trait implementations at all. If you prefer to use If you are also using |
Hi clux, Thanks your Reply In fact I use k8s_openapi |
I am curious about your has kind/version on the list wrapper struct, there's only |
Thanks for your reply |
Hi All,
I think this is a issue of listed all Objects in a CRD
Like the output of
kubectl get <CRD> -o json
showskopium 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
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
ListableResource
&&Resource
derive
Attribute on CRD StructFor this Issue, Does anyone have a better solution?
The text was updated successfully, but these errors were encountered: