-
Notifications
You must be signed in to change notification settings - Fork 405
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Fix XValidations flattening #998
base: master
Are you sure you want to change the base?
Conversation
Welcome @cezarsa! |
Hi @cezarsa. 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. Instructions 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cezarsa The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
Do we need to consider the ordering in flattening? CRD validations are executed in order so do we think the field level validations or the struct level validations should come first? What will happen with this approach, I assume the output here is deterministic? |
It is deterministic and, with the current approach, struct-level validations will come first. This kinda makes sense to me but I don't have a definitive answer if this is the intended behavior or if this has been discussed before. Ultimately, I don't think the order can affect the correctness or the cost budget for the validations as they are all executed even after a failed rule. |
Is that true? I was under the impression that if a rule failed, further rules were not executed until the earlier rule passed? Either way, I guess that doesn't hugely matter since all rules must pass for the object to be accepted. I would be tempted to poke some of the API machinery folks though just in case they can foresee any issues here/have a suggestion for prioritisation |
Yes, I just tested it to be sure, using controller-gen from this branch and with an object declared as:
Applying it returned all the validation errors:
|
Fixes #997
This PR ensures XValidations are merged correctly when flattening the CRD schema.