Commit 59ebfbb
fix: pre-NodeUpdate cleanup — metrics, deletion comment, drift-gated plans (#93)
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>1 parent c771542 commit 59ebfbb
3 files changed
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | | - | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 450 | + | |
| 451 | + | |
453 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
454 | 460 | | |
455 | 461 | | |
456 | 462 | | |
| |||
0 commit comments