-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
feat: Add storage and served argument to derive macro #1644
feat: Add storage and served argument to derive macro #1644
Conversation
5c10fce
to
77b699f
Compare
Signed-off-by: Techassi <[email protected]>
Signed-off-by: Techassi <[email protected]>
Signed-off-by: Techassi <[email protected]>
77b699f
to
fda8d52
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1644 +/- ##
=======================================
+ Coverage 75.5% 75.6% +0.1%
=======================================
Files 82 82
Lines 7403 7405 +2
=======================================
+ Hits 5589 5591 +2
Misses 1814 1814
|
Hey, thanks for this. I think this is reasonable, but just wondering if you've seen the |
Yes, and I'm using it. Afaik the The Kubernetes docs recommend setting
Sure, you can check my current work out here: https://github.com/stackabletech/operator-rs/tree/main/crates/stackable-versioned-macros |
Okay, yeah, that's way more advanced than I've had to deal with. Happy to send this through. Thank you! |
Cool, thanks! Seems like I need to re-format using an older Rust edition (I used my default formatter, which uses newer formatting rules). Just out of curiosity, why do you still format the code according to the 2018 edition? |
The important part there is that it's nightly rather than stable, and this forces a custom command rather than LSP defaults. I don't think the edition matters a whole deal, although we should also bump it (EDIT: done). The nightly things we use are here #707 . Sadly they've taken a very long time to stabilise. |
7ad3329
to
99d3ebc
Compare
Ah, okay! Some of these rules are available in other tooling tho, such as rust-analyzer, but I can see that you don't want to rely on that. I re-applied the formatting and the CI checks should now succeed. |
Looks great, thank you! |
Lovely, thank you as well! |
As I know of no better way, I'll just ping you here that I have at least one more PR planned for the derive macro. The upcoming change could also be included in the 0.98.0 release. Also, what is the timeline for 0.98.0 so that I can plan accordingly? |
Sounds good! Normally I only really try to do roughly one minor a month, but it's not set in stone. If there's an k8s-openapi release (at some point after kubernetes 1.32 releases) we always release regardless. That might be a good one to aim for. If not, happy to do to one when you are at a reasonable checkpoint with derive. |
This PR adds two new arguments to the derive macro:
storage
andserved
. This allows users to customize these two values in the schema.Motivation
Currently it is not possible to customize these two properties using the derive macro because they are hard-coded to be both
true
. Adding support for setting these two properties is highly valuable when a CRD with multiple versions is used.Solution
Add two new arguments to make the properties customizable.