Skip to content

fix: only append to appliedNodes after successful node evaluation#216

Open
rawadhossain wants to merge 1 commit intokubernetes-sigs:mainfrom
rawadhossain:fix/appliednodes
Open

fix: only append to appliedNodes after successful node evaluation#216
rawadhossain wants to merge 1 commit intokubernetes-sigs:mainfrom
rawadhossain:fix/appliednodes

Conversation

@rawadhossain
Copy link
Copy Markdown

Description

This change prevents nodes from appearing in both status.appliedNodes and status.failedNodes during rule reconciliation.

Previously, nodes were added to appliedNodes before evaluateRuleForNode ran. If evaluation fails, the same node ends up in failedNodes as well. so it shows up in both lists in a single reconcile.

There’s also a related case where a node that previously failed but later succeeds can still have a stale entry in failedNodes, so it continues to appear in both lists even after recovery.

To fix this:

  • only add nodes to appliedNodes when evaluateRuleForNode succeeds
  • remove any existing failedNodes entry for a node when it evaluates successfully
  • add tests covering both failure and recovery scenarios

This keeps appliedNodes aligned with its intended meaning (nodes where the taint was successfully managed) and avoids overlap with failedNodes.

Related Issue

Fixes #215

Type of Change

/kind bug

Testing

  • Added tests to cover:
    • evaluation failure: node is not added to appliedNodes and appears in failedNodes
    • recovery case: stale failedNodes entry is removed and node is added to appliedNodes
  • Ran:
    • make test
    • make lint

Checklist

  • make test passes
  • make lint passes

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 5, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rawadhossain
Once this PR has been reviewed and has the lgtm label, please assign tallclair 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 k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 5, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit dae555a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/69fb191320ac930008c684ef

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 5, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 5, 2026
Signed-off-by: Rawad Hossain <rawad.hossain00@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 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.

Nodes appear in both appliedNodes and failedNodes on evaluation failure

2 participants