Skip to content

fix: pre-NodeUpdate cleanup — metrics, deletion comment, drift-gated plans#93

Merged
bdchatham merged 1 commit intomainfrom
fix/pre-nodeupdate-cleanup
Apr 16, 2026
Merged

fix: pre-NodeUpdate cleanup — metrics, deletion comment, drift-gated plans#93
bdchatham merged 1 commit intomainfrom
fix/pre-nodeupdate-cleanup

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Summary

Three items from the comprehensive architecture review, cleaning up before NodeUpdate implementation:

  1. Fix controllerName() metrics — GVK is stripped by controller-runtime on fetched objects, so all plan metric labels were "unknown". Now uses a type switch on known resource types.

  2. Document deletion path exceptionhandleNodeDeletion has its own Status().Patch() which is intentional (runs before the main reconcile flow). Added a comment so it's not mistaken for drift from the single-patch model.

  3. Drift-gated Running plansbuildRunningPlan now returns nil when spec.image == status.currentImage (no drift). This eliminates unnecessary plan creation every 30s for idle nodes and establishes the hook where NodeUpdate drift detection will live.

Test plan

  • make build && make test && make lint — all green

🤖 Generated with Claude Code

…plans

Three cleanup items identified during the comprehensive architecture review:

1. Fix controllerName() in planner metrics — GVK is stripped by
   controller-runtime on fetched objects, so all metric labels were
   "unknown". Now uses a type switch on the known resource types.

2. Document the deletion path's separate Status().Patch() call — it's an
   intentional exception to the single-patch model, not an oversight.

3. Running-phase plans are now drift-gated — buildRunningPlan returns nil
   when spec.image == status.currentImage (no drift). This eliminates
   unnecessary plan creation/flush/execution every 30s for idle Running
   nodes, and establishes the extension point for NodeUpdate plans.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 59ebfbb into main Apr 16, 2026
2 checks passed
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.

1 participant