Skip to content
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

define a CustomResourceExt in kube for kube-derive #497

Closed
3 tasks done
clux opened this issue Apr 19, 2021 · 1 comment · Fixed by #545
Closed
3 tasks done

define a CustomResourceExt in kube for kube-derive #497

clux opened this issue Apr 19, 2021 · 1 comment · Fixed by #545
Labels
api Api abstraction related derive kube-derive proc_macro related

Comments

@clux
Copy link
Member

clux commented Apr 19, 2021

For methods like ::crd and ::api_resource (see #495). Came up on discord last week, and it'll be useful to keep some guarantee on the generated code.

  • define trait in kube_core/src/crd.rs - probably fine to only target apiextensions v1
  • impl CustomResourceExt in kube-derive
  • figure out a migration strategy for v1beta1 users

cc @lfrancke.

@clux clux added api Api abstraction related derive kube-derive proc_macro related labels Apr 19, 2021
@lfrancke
Copy link
Contributor

Sorry for the late reply.
Yes, I think it'd be useful to have those in a trait.

I only have a single use-case in mind but I'm sure there are more.
If ::crd were behind a trait I could create a simple method to write a CRD YAML to a file, to stdout or even to create it in Kubernetes for any resource. Now it needs custom code for every CRD.

@clux clux added good first issue Good for newcomers help wanted Not immediately prioritised, please help! labels May 4, 2021
@clux clux removed good first issue Good for newcomers help wanted Not immediately prioritised, please help! labels Jun 6, 2021
@clux clux linked a pull request Jun 6, 2021 that will close this issue
@clux clux closed this as completed in #545 Jun 8, 2021
clux added a commit that referenced this issue Jun 8, 2021
* add a versioned CustomResourceExt trait - fixes #497

* less import lines

* simplify cargo release flags via crate-ci/cargo-release#253

* new clippy lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Api abstraction related derive kube-derive proc_macro related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants