Skip to content

fix: emit Warning events on node and rule when taint operations fail - #424

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

fix: emit Warning events on node and rule when taint operations fail#424
Saloni3494 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Saloni3494:issue-362

Conversation

@Saloni3494

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:
This PR resolves an observability gap where the controller failed to emit Warning events when node taint operations failed.

Previously, if addTaintBySpec or removeTaintBySpec failed (e.g., due to API server RBAC restrictions or patch conflicts), the controller would log an error and increment metrics.Failures, but operators had no visibility into these failures through kubectl describe nodereadinessrule or kubectl describe node.

Now, if a taint addition or removal fails, the controller explicitly emits a Warning event on both the affected Node object and the managing NodeReadinessRule object with the exact underlying error message.

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

Special notes for your reviewer:
The events use the standard RemoveTaintFailed and AddTaintFailed reasons so they are easily recognizable in kubectl get events.

Does this PR introduce a user-facing change?:

Fixed a bug where the controller failed to emit Kubernetes Warning events on Node and NodeReadinessRule objects when taint operations failed.

@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller canceled.

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

@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 ajaysundark 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 18, 2026
@ajaysundark

Copy link
Copy Markdown
Contributor

Duplicate Of #363

/close not-planned

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Controller emits zero Warning events on NodeReadinessRule or Node objects when taint operations fail

2 participants