Skip to content

fix: avoid taint cleanup for dry-run rules (#374) - #399

Open
alanhuangch wants to merge 1 commit into
kubernetes-sigs:mainfrom
alanhuangch:fix/dry-run-finalizer-cleanup
Open

fix: avoid taint cleanup for dry-run rules (#374)#399
alanhuangch wants to merge 1 commit into
kubernetes-sigs:mainfrom
alanhuangch:fix/dry-run-finalizer-cleanup

Conversation

@alanhuangch

Copy link
Copy Markdown
Contributor

Description

Prevent deleting an always-dry-run NodeReadinessRule from removing pre-existing Node taints. The cleanup finalizer is now added only when a rule enters enforcement and is retained across later transitions back to dry-run.

Related Issue

Fixes #374

Type of Change

/kind bug

Testing

  • make test passes (including controller-gen, gofmt, go vet, and all non-e2e tests; controller suite 64/64)
  • make lint passes (golangci-lint and kube-api-linter)

Checklist

  • make test passes
  • make lint passes

Does this PR introduce a user-facing change?

Yes: deleting a rule that remained in dry-run mode no longer mutates Node taints.

Deleting an always-dry-run NodeReadinessRule no longer removes matching pre-existing Node taints.

@kubernetes-prow kubernetes-prow Bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 13, 2026
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller canceled.

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

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alanhuangch
Once this PR has been reviewed and has the lgtm label, please assign haircommander 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 13, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @alanhuangch. 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.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 13, 2026
@ajaysundark
ajaysundark self-requested a review August 19, 2026 12:58
@ajaysundark

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 20, 2026
@ajaysundark

Copy link
Copy Markdown
Contributor

I understand the rationale here, but wouldnt a 'stuck' taint has more side effects than cleaning it up? From a safety standpoint, erring on the side of cleaning up taints might be preferable.

Even in a scenario where a user deletes a dry-run rule to update and reapply it, NRC would re-add missing taints to enforce readiness anyway. Could you clarify where do you see leaving the taints is preferred here?

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. ok-to-test Indicates a non-member PR verified by an org member that 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.

[BUG] Deleting a dry-run NodeReadinessRule removes matching pre-existing taints

2 participants