-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Remove invalid uniqueItems
property from CRDs when Sets are used
#1484
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1484 +/- ##
=======================================
+ Coverage 74.4% 74.4% +0.1%
=======================================
Files 78 78
Lines 6775 6778 +3
=======================================
+ Hits 5034 5037 +3
Misses 1741 1741
|
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 for reporting this. I think the fix makes sense. Unsure of whether it makes sense to feature gate it to above Kubernetes 1.30 via k8s_if_le_1_30
but that requires k8s-openapi to actually release an 1.30 one first.
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
55a740f
to
c64c3d0
Compare
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
Sorry for force-pushing, as always I forgot to sign my commits... Maybe my "As of version 1.30 Kubernetes does not support [...]" comment was a bit misleading. With that in mind would a feature gate still make sense here? |
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 makes sense to me. Thanks!
A feature gate might make sense, but that would mean we wait to include this until we can gate on 1.30 (so basically bump openapi, merge this with a gate, then release next kube). 🤔 |
Do you have a source for the removal of uniqueItems support? |
I still can't wrap my head around the whole feature gate thing. They earliest occurrence of this error message I could find is from 2017: kubernetes/kubernetes@fd09c3d |
Ah, then I don't think we don't need to feature gate it imo as it's always been considered invalid (even if it hasn't been promoted to a hard error until recently). If people care about it then they can fix it properly with the override, and they will actually see the effects of this immediately with our change here (by us changing the CRD output slightly) so it should be more helpful to get this immediately than to wait for 1.30. |
uniqueItems
property from CRDs when Sets are used
Ah that was the part I was missing. Thanks for the clarification! |
Motivation
This fixes the error message
Forbidden: uniqueItems cannot be set to true since the runtime complexity becomes quadratic
in case aHashSet
(or similar) is used.Solution
Don't write the field
uniqueItems
.Ideally we could set
x-kubernetes-list-type
instead, but I'm not really comfortable making this change as I'm not so deep into this topic.