Comments (4)
I think that's probably the current minimal if you want to use k8s_openapi
's api feature.
The #[kube]
instrumentation we provide in kopium
is meant to simplify the use with kube::Api
which can then be used as:
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 k8s-openapi
directly you might want to turn off the #[kube]
insturmentation with kopium --hide-kube
, to avoid needing to depend on kube if you are not using it for its client feature.
If you are also using kube
, is there any reason why you use the k8s-openapi
client?
from kopium.
Hi clux, Thanks your Reply
In fact I use k8s_openapi
Mostly because it provides basic K8S Kind Struct support
(like Pod / Node / NS ... etc.)
And I need the CRD part to support the List output function
The List defined by kube-rs only has the metadata / items field
Relative to the kubectl get <CRD> -o json
operation
will be missing kind / version information
I think these two should be standard API will have the opportunity to use
So use k8s_openapi to reproduce List functionality
from kopium.
I am curious about your List
issue there as neither:
has kind/version on the list wrapper struct, there's only TypeMeta
on the elements inside .items
.
historically the apiserver did not use to return apiVersion
and kind
at all in list calls, but i see it does generate {"apiVersion": "v1", "kind": "List", ...}
now. Is this something that is useful for you? We could open an issue in kube and solve it there if it's now guaranteed by the apiserver.
from kopium.
Thanks for your reply
I'm also very interested in this plan
It will help me a lot
Because kubectl
outputs -o yaml
information
It appears to be fixed given { "apiVersion": "v1", "kind": "List" }
At present, not sure whether API Server can directly provide List return
So I not sure this is extend data overwrite with kubectl or not
from kopium.
Related Issues (20)
- Top level enums are not handled
- Add support for cargo-binstall HOT 1
- Address clippy fixes in the generated documentation HOT 1
- Argo-Workflows crd's not working HOT 2
- Types with Underscore not converted to CamelCase
- Kopium skips generating types which are then not referencable
- Use `indoc` for analyzer test cases
- Document Unstable Rust HOT 1
- allow filtering out the status object
- crash on flux's GitRepository crd HOT 2
- Allow implementing generic getter traits
- Missing Struct when generating from CRD HOT 2
- Autogenerated output should include a comment at the top of file HOT 2
- enum support in 0.12 breaks --derive Default HOT 4
- not handling non-string enum HOT 5
- alertmanager crd needs support for invalid enum names HOT 2
- alertmanager crd crashes on empty enum string crd HOT 1
- allow eliding output from problematic containers
- Include a comment with the arguments to kopium in the generated code itself
- Running kopium with `--hide-kube` still includes a derive for `CustomResource` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kopium.