add a versioned CustomResourceExt trait - fixes #497 #545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Had a bit of a go at #497, and realised it's not quite that beginner worthy because of one hairy problem:
The new trait needs to hardcode the
CustomResourceDefinition
type fromk8s_openapi
if we want to keep enforcing the struct (and we probably should).Unfortunately, doing this effectively hardcodes the apiextensions version and makes things using
#[kube(apiextensions = "v1beta1")]
not compile.So, a couple of options present themselves:
I think for sake of stability guarantees and #508 parallel traits actually work here:
#[kube(apiextensions = "v1beta1")]
can select the trait and implement the right oneSo, if this seems acceptable. I propose this can perhaps serve as a guiding principle for #508
I.e. this case: we can remove
kube_core::crd::v1beta1
when kubernetes 1.22 is the minimum EKS/AKS/GKE version.