Repository navigation
Commit 2e24709
fix(apps/kubernetes): make pre-delete hook steps 3/5/6 fire-and-forget (#3271)
The Step-2 fix already merged with #2826 bounded the child-HelmRelease wait,
but the pre-delete hook's remaining teardown steps still inherited kubectl's
default --wait=true with no timeout:
Step 3 delete KamajiControlPlane
Step 5 delete DataVolumes
Step 6 delete LoadBalancer Services
Unlike the child HelmReleases in Step 2 — whose Flux finalizer only clears once
helm-controller can uninstall INSIDE the tenant cluster, which is impossible on
a nodeless tenant — these three target resources are finalized by controllers
in THIS management cluster (Kamaji/CAPI, CDI + the CSI driver, the LB
controller). Their teardown does not depend on tenant node health, so there is
nothing to wait for on the Kubernetes-CR finalization path. Waiting only hurt:
- Step 5's unbounded wait blocked the pre-cleanup Job until every worker-disk
PVC was physically reclaimed; under storage pressure (the exact #3271 failure
mode) that exceeds the parent Helm uninstall budget and wedges teardown.
- Step 3's unbounded wait ran ahead of Step 4 on the same TCP teardown, so it
could defeat Step 4's bounded wait + Step 4b datastore-secret backstop.
Make all three --wait=false (fire-and-forget) and non-fatal (|| echo WARNING),
so the Job completes fast, the parent Helm uninstall succeeds and the CR
finalizes. The actual VM/PVC drain is waited on separately and best-effort by
the caller (the e2e cozy_wait_tenant_drained barrier), not on the
CR-finalization path — this restores the layering the kubernetes e2e harness
was built around. Deliberately do NOT force-clear a stuck PVC/DataVolume
finalizer: that would orphan the LINSTOR backing volume; a genuinely wedged PVC
surfaces honestly as a Terminating namespace instead of being masked.
Step 2 (bounded wait + child-HR finalizer force-clear) and Step 4/4b are left
untouched — those are the paths that legitimately need a wait.
Pins the new behavior in tests/delete_hook_test.yaml with step-local regexes
(anchored to each command's own continuation lines, not a loose gap that would
match a later step's flag and pass vacuously — mutation-verified).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-By: Claude <[email protected]>1 parent 99a28d8 commit 2e24709
2 files changed
Lines changed: 97 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
93 | 104 | | |
94 | | - | |
| 105 | + | |
| 106 | + | |
95 | 107 | | |
96 | 108 | | |
97 | 109 | | |
| |||
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
141 | 168 | | |
142 | 169 | | |
143 | | - | |
| 170 | + | |
| 171 | + | |
144 | 172 | | |
145 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
146 | 180 | | |
147 | 181 | | |
148 | 182 | | |
149 | | - | |
| 183 | + | |
| 184 | + | |
150 | 185 | | |
151 | 186 | | |
152 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
0 commit comments