Skip to content

Fix stale NodeStatus entries in StaticRoute resources when their corresponding Kubernetes nodes are removed. - #131

Open
FilatovM wants to merge 1 commit into
IBM:masterfrom
FilatovM:fix/delete-stale-node-statuses
Open

FilatovM wants to merge 1 commit into
IBM:masterfrom
FilatovM:fix/delete-stale-node-statuses

Conversation

@FilatovM

@FilatovM FilatovM commented Oct 9, 2026

Copy link
Copy Markdown

Fix for raised issue - #129

When a Kubernetes node disappears unexpectedly, its corresponding entry can remain in StaticRoute.Status.NodeStatus indefinitely. This can leave outdated status information and interfere with the cleanup of StaticRoute resources.

Changes:

  • Remove stale node statuses: Periodically compare StaticRoute.Status.NodeStatus entries with existing Kubernetes nodes and remove entries for nodes that no longer exist.

  • Support hostname matching: Match node statuses against both Kubernetes node names and the kubernetes.io/hostname label.

  • Reconcile periodically: Recheck resources every minute to detect nodes that disappear without the operator having an opportunity to clean up their status entries.

  • Improve deletion handling: Allow finalizer cleanup to proceed when a deleting StaticRoute has no remaining node statuses.

  • Handle errors: Propagate failures when listing Kubernetes nodes or updating the StaticRoute status.

  • Add test coverage: Update controller mocks and tests to cover stale status cleanup and the associated reconciliation behavior.

@Tamas-Biro1 Tamas-Biro1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution for Static Route operator!

I added some comments and suggestions, also i'm open for further discussion on this issue. Thanks!

@FilatovM
FilatovM force-pushed the fix/delete-stale-node-statuses branch from 2a2505d to 97ac59f Compare October 12, 2026 12:49
Signed-off-by: Mikhail Filatov <misha.filat@gmail.com>
@FilatovM
FilatovM force-pushed the fix/delete-stale-node-statuses branch from 97ac59f to c6aad97 Compare October 12, 2026 12:50
@FilatovM
FilatovM requested a review from Tamas-Biro1 October 13, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants