-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
implement more bindings to the standard api-resources #25
Comments
Note that not all objects fit the Resources that definitely are snowflakes:
#35 for context. https://kubernetes.io/docs/reference/federation/v1/definitions/ for actual api of what's required. Likely necessary to look at when implementing these. |
I'd like to take a stub at |
This is somewhat less of a hassle now that we only need two lines in the api module: k8s_obj!("Service", "v1", "api");
k8s_ctor!(Service, "v1", k8s_openapi::api::core); Though it would be nice to have a way to automatically detect the objects from k8s api / openapi crate so that we could generate the ones that existed. Perhaps it is possible to expose the If we can generate a declarative format for all the native api types, then we could possibly even build kube with just the objects needed with a build script evar - though that's probably unnecessarily over-engineered. Still, being able to define all types easily from an upstream spec in a format we can derive would be super helpful. |
Potentially even easier on nightly with const generics: struct Attacher<const N: usize> {}
impl<const N: usize> Attacher<N> {
const fn attach(values: [&str; N]) -> () {
k8s_obj!(c, "v1", "", "api");
k8s_ctor!(c, "v1", k8s_openapi::api::core);
}
}
const CORE_OBJS: [&str; 8] = ["Pod", "Node", "Service", "Namespace", "PersistentVolume", "ResourceQuota", "PersistentVolumeClaim", "ReplicationController"];
static Y: [(); 8] = Attacher::<8>::attach(CORE_OBJS); |
Going to allow arbitrary k8s_openapi objects to work thanks to trait in the upstream crate. This will be fixed in #157 |
No longer necessary from next version since we can use any |
We got core::v1 covered AFAIKT. But a quick peek at the openapi spec shows there's still tons of uncovered resources.
As a starting point, let's aim to cover the normal
kubectl api-resources
output:That's what a 1.13 cluster supports (but took out some extensions == v1beta versions of workloads api).
There's many ways of finding the
Api
values for a resource. One way is to browse to the openapi spec for a resource - hereService
as an example. Then view src on the firstcreate
request which should easily show a__url
of the form:In this case we can infer the resource is:
(note the v1 version + apis prefix and unset namespace defaults).
It would need a
v1Service
constructor inRawApi
.It would also need the following entry for the "openapi" users:
The text was updated successfully, but these errors were encountered: