Commit 067f3d5
test(janitor): wait for reconciler to settle before immutability Update
Locally reproduced the CI failure with a focused envtest harness
(creating, snapshotting rv, then doing a stale-rv Update gets the exact
"the object has been modified" 409 error, just like CI). The apiserver
treats the client-supplied resourceVersion as a precondition on Update;
when the reconciler bumps the rv between the test's Get and Update, the
request short-circuits with 409 BEFORE admission webhooks run, so the
test never sees the webhook's "nodeName cannot be changed" rejection.
The sibling lifecycle tests don't hit this because their Setup waits for
NVSentinelOwnershipReleased=True (which parks the dispatcher in the
no-op branch). Mirror that gate here — once Released=True there are no
more reconciler writes to race against, so the fresh Get→Update has a
stable rv and admission gets to run.
Also tightens the Teardown to mirror the other lifecycle tests: drive
finalizer-based cleanup via DeleteAllCRs, plus a Node scrub as
belt-and-suspenders if the finalizer path didn't complete.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 432d76a commit 067f3d5
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
92 | 103 | | |
93 | | - | |
| 104 | + | |
| 105 | + | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| |||
0 commit comments