fix: reject anyOf conditionPolicy when defaultStatus equals requiredS… - #425
fix: reject anyOf conditionPolicy when defaultStatus equals requiredS…#425Saloni3494 wants to merge 1 commit into
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Saloni3494 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 |
|
Hi @Saloni3494. 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 Regular contributors should join the org to skip this step. 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. |
|
Duplicate Of #418 /close not-planned |
|
@ajaysundark: PRs cannot be closed as Not Planned. DetailsIn response to this:
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. |
What type of PR is this?
What this PR does / why we need it:
This PR prevents a silent failure mode where
conditionPolicy: anyOfrules could short-circuit themselves due to a misconfiguration indefaultStatus.As identified in #414, if an
anyOfrule has a condition wheredefaultStatus == requiredStatus, the rule evaluates to "Satisfied" the moment the node is evaluated (assuming the condition is not present on the node, which is typical at startup). This causes the controller to immediately skip taint application, acting as a complete no-op without any logged warnings or errors.This PR adds a CEL validation rule to
NodeReadinessRuleSpecthat rejects the CRD at the API server level ifconditionPolicyisanyOfand any condition'sdefaultStatusequals itsrequiredStatus.Which issue(s) this PR fixes:
Fixes #414
Special notes for your reviewer:
Does this PR introduce a user-facing change?: