-
-
Notifications
You must be signed in to change notification settings - Fork 372
Transform optional enums to match pre kube 2.0.0 format #1853
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1853 +/- ##
=======================================
+ Coverage 74.7% 74.8% +0.1%
=======================================
Files 84 84
Lines 7938 7951 +13
=======================================
+ Hits 5925 5940 +15
+ Misses 2013 2011 -2
🚀 New features to boost your workflow:
|
7d9bcce to
f93db71
Compare
clux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks sensible to me. minor nits only.
need to look at the bigger PR though.
Signed-off-by: Danil-Grigorev <[email protected]>
f93db71 to
e4e239b
Compare
clux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Easy to review. Maybe let's wait for a response on #1839 first. They have tests for this exact transform, and it'd be good to preserve those / get some tests for this.
let's wait with this. the #1893 pr is more holistic approach, so lets see if we can get that merged first.
clux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given the scope of the other pr, and time concerns, i'm leaning more towards this pr again
Motivation
Schemars bump to 1.0 with kube 2.0 broke optional enum CRD generation. Verified it with schemars 1.1.0 - problem still exists.
Solution
Introduce an
OptionalEnumtransform to allow usage ofOption<Enum>as inkube1.0.0 withschemars < 1.0.0.Removes incompatible output of schema generator with:
{ "anyOf": [ { "enum": ["Debug", "Info", "Error"], "type": "string" }, { "enum": [null], "nullable": true } ] }replacing it with expected:
{ "enum": ["Debug", "Info", "Error"], "type": "string", "nullable": true }Fixes: #1821