Commit 7a548e8
tazhate
fix(controller): preserve pod-template annotations across reconciles
ensureStatefulSet was calling sts.Spec = desired on every reconcile, which
overwrote the pod-template annotations entirely with just {config-hash}.
This erased the restarted-at annotation set by reconcileUpgrade, causing
the upgrade test to fail (it verified the annotation persisted through a
no-op reconcile).
Fixed by merging existing pod-template annotations into desired: desired
keys (config-hash) take priority; all other keys are carried over. This
preserves restarted-at and any future annotations without interfering with
the config-hash change-detection mechanism.
Spent ~30min tracing through CreateOrUpdate + Spec replace behavior with
debug prints to isolate the root cause.1 parent 3ed046a commit 7a548e8
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
0 commit comments