feat: migrate bootstrap-only validations to CEL - #451
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
Hi @vishnukothakapu. 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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain 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. |
|
Heads up on a collision with #455, which migrates the nodeSelector check to CEL. Different constraint to yours, but we overlap on four files. Two concrete spots. You delete the The one worth knowing about is in Expect(allErrs).To(HaveLen(1)) // Empty nodeSelector validation
Expect(allErrs[0].Field).To(Equal("spec.nodeSelector"))That holds today but stops holding once #455 removes the empty check from the webhook, so whichever of ours merges second needs that repointed at an unparseable selector rather than an empty one. Happy to rebase mine on yours if you land first, no preference. |
|
Same thing I flagged on #455: the chart CRD didn't get regenerated. Both new bootstrap-only rules are in |
39834ad to
20889e9
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vishnukothakapu, yindia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
20889e9 to
6115d07
Compare
|
/cc @ajaysundark |
Description
This PR completes the migration of the remaining
bootstrap-onlyenforcement validations from the admission webhook to native CELXValidationmarkers on theNodeReadinessRuleSpec.Specifically, it blocks two invalid configurations directly at the API level:
enforcementMode: bootstrap-onlycombined withdefaultStatusenforcementMode: bootstrap-onlycombined withconditionPolicy: anyOfThis aligns with the clean hybrid approach established in PR #418, ensuring standard user templates using
allOfcontinue to work while safely short-circuiting unsupported bootstrap-only configurations without the need for a webhook round-trip.Changes include:
XValidationmarkers tonodereadinessrule_types.gonodereadinessgaterule_webhook.goenvtesttest casesRelated Issue
Fixes #449
Type of Change
/kind feature
/kind api-change
/kind cleanup
Testing
envtestcases were added tonodereadinessrule_controller_test.goto explicitly verify that the API server rejects these invalid manifests during creation.Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?