Skip to content

fix: cleanup taints after node selector mismatch#236

Open
sahitya-chandra wants to merge 1 commit intokubernetes-sigs:mainfrom
sahitya-chandra:fix-node-label-selector-taint-cleanup
Open

fix: cleanup taints after node selector mismatch#236
sahitya-chandra wants to merge 1 commit intokubernetes-sigs:mainfrom
sahitya-chandra:fix-node-label-selector-taint-cleanup

Conversation

@sahitya-chandra
Copy link
Copy Markdown
Contributor

Description

Fixes stale rule-managed taints when a node label change causes the node to stop matching a NodeReadinessRule selector.

The node reconciler now considers rules that previously recorded node-specific status, even if the node no longer matches the selector. For those previously managed nodes, it removes the rule-managed taint and prunes node-specific status (appliedNodes, nodeEvaluations, and failedNodes). Rules with no prior status for the node are left alone, so unrelated pre-existing taints are not removed.

Related Issue

Fixes #235

Type of Change

/kind bug

Testing

  • Added a regression test covering a node label change from matching to non-matching selector.
  • make test
  • make lint

Checklist

  • make test passes
  • make lint passes

Does this PR introduce a user-facing change?

Fixed stale NodeReadinessRule-managed taints left on nodes that stop matching the rule nodeSelector after label changes.

Signed-off-by: Sahitya Chandra <sahityajb@gmail.com>
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 10, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 10, 2026

Deploy Preview for node-readiness-controller canceled.

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

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sahitya-chandra
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

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @sahitya-chandra. 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 10, 2026
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. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node label changes can leave stale rule-managed taints after nodeSelector no longer matches

2 participants