Arnavion / k8s-openapi

Rust definitions of the resource types in the Kubernetes client API
Apache License 2.0
379 stars 41 forks source link

Selectively build API groups? #77

Open nightkr opened 3 years ago

nightkr commented 3 years ago

k8s-openapi compiles very slowly. That isn't really a dig on it, it's just a big crate.

But it would be nice if we could opt in to which APIs are actually relevant.

I figure a decent first approximation would be to have a cargo feature per apiVersion, which are already used for module separation anyway.

Arnavion commented 3 years ago

It's not impossible, though it will require the codegen process to keep track of cross-module dependencies. Eg everything depends on meta/v1, so enabling anything else should also enable the meta/v1 feature. (Well, meta/v1 will need to be enabled by default anyway because of how fundamental it is, but you get the idea.)

Also, the feature names will have to incorporate the whole path so that they're unambiguous, eg apimachinery/pkg/api/resource -> "apimachinery_pkg_api_resource"