-
Notifications
You must be signed in to change notification settings - Fork 467
✨crd/marker: add AtLeastOneOf constraint #1278
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
|
Hi @shashankram. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
cc @JoelSpeed @alvaroaleman who reviewed #1212 |
|
@shashankram Would you mind splitting this PR in two? Moving to ginkgo v2 is definitely something we should do, but lets not muddle it with the rest of this PR, they should be separate |
a2d5e94 to
f5cff41
Compare
@JoelSpeed done |
|
@shashankram Did you create a separate PR for the ginkgo v2 stuff? If you haven't, are you able to? Also please make sure to update the PR description |
JoelSpeed
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.
In theory, in a lot of cases, adding a MinProperties would be sufficient wouldn't it? You'd be able to specify that at least one property must be set on the object?
This is helpful though in the case where you've mixed your fields with other fields and you need at least one of them, without caring about their siblings?
| // +kubebuilder:validation:AtMostOneOf=a;b | ||
| // +kubebuilder:validation:ExactlyOneOf=c;d | ||
| // +kubebuilder:validation:AtLeastOneOf=e;f | ||
| type TypeWithAllOneofs struct { |
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.
To match the others?
| type TypeWithAllOneofs struct { | |
| type TypeWithAllOneOfs struct { |
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.
It currently matches the casing with other type names
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.
Oh, odd, I thought we should have gone with OneOf, i was suggesting to align to the comment lines 84-86. We probably should have done that casing for the previous cases as well
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.
I don't want to increase the scope of this PR, given that has been an issue with other renames/formatting in previous PRs of mine. Let's keep this as-is since it has no functional effects
Yes, this is quite a common scenario so this marker would be useful. |
I'll open a separate PR once this merges |
|
@JoelSpeed this should be good to merge |
|
/assign I'll take a look once Joel lgtm's |
|
/ok-to-test |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: b63c502c717b5c4cff890eb0cadba775e992ef5d |
|
Thank you! /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer, shashankram The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Uh oh!
There was an error while loading. Please reload this page.