Skip to content

fix: reject anyOf conditionPolicy when defaultStatus equals requiredS… - #425

Closed
Saloni3494 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Saloni3494:issue-414
Closed

fix: reject anyOf conditionPolicy when defaultStatus equals requiredS…#425
Saloni3494 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Saloni3494:issue-414

Conversation

@Saloni3494

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:
This PR prevents a silent failure mode where conditionPolicy: anyOf rules could short-circuit themselves due to a misconfiguration in defaultStatus.

As identified in #414, if an anyOf rule has a condition where defaultStatus == 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 NodeReadinessRuleSpec that rejects the CRD at the API server level if conditionPolicy is anyOf and any condition's defaultStatus equals its requiredStatus.

Which issue(s) this PR fixes:
Fixes #414

Special notes for your reviewer:

  • Added an E2E test to verify that the API server correctly rejects the misconfigured manifest.

Does this PR introduce a user-facing change?:

Added CEL validation to reject NodeReadinessRules with conditionPolicy `anyOf` when a condition's `defaultStatus` matches its `requiredStatus`, preventing silent misconfigurations.

@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit c7cec8a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a83cfa2c9e45b0008fcbc0a

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Saloni3494
Once this PR has been reviewed and has the lgtm label, please assign dchen1107 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 18, 2026
@kubernetes-prow

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@kubernetes-prow kubernetes-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 18, 2026
@ajaysundark

Copy link
Copy Markdown
Contributor

Duplicate Of #418

/close not-planned

@kubernetes-prow

Copy link
Copy Markdown

@ajaysundark: PRs cannot be closed as Not Planned.

Details

In response to this:

Duplicate Of #418

/close not-planned

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] anyOf conditionPolicy with defaultStatus == requiredStatus silently short-circuits rule

2 participants