Commit 572e08a
committed
fix(platform): migration 42 uses a single declarative apply
Address review feedback from @lllamnyp on packages/core/platform/images/
migrations/migrations/42: the previous version did `kubectl label --overwrite`
then `kubectl apply` on a manifest with no labels, relying on `kubectl apply`'s
3-way strategic merge to leave the imperatively-set label intact. That works
in the steady state but is fragile — the contract is "the label is preserved
because it is never in last-applied-configuration" — and it is inconsistent
with the helm template at templates/cozystack-version.yaml, which bakes the
label inline.
Replace the two-step dance with one declarative apply that includes the
deletion-protection label, matching the chart template. One source of truth,
no last-applied-merge subtlety. The script remains idempotent (apply is a
no-op once the ConfigMap matches).
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>1 parent 84c2aaa commit 572e08a
1 file changed
Lines changed: 20 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
20 | 34 | | |
21 | | - | |
| 35 | + | |
| 36 | + | |
22 | 37 | | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 41 | + | |
| 42 | + | |
0 commit comments