Clear the stale drain deadline on a re-adopted ReplicaSet - #179
Clear the stale drain deadline on a re-adopted ReplicaSet#179darkmuggle wants to merge 1 commit into
Conversation
|
you clear the stale remove-version-at with first, the question: after this fix force-removes the annotation, the operator will later have to write it back on; the next time this version is superseded, the original field manager stamps the removal deadline again. does that later write land cleanly? or does this fix having force-taken ownership of the (now-removed) annotation make that write conflict and get silently dropped, so the deadline is never written and the version never drains? i was thinking of suggesting a test for it but it would be e2e only. and i appreciate that it's only here because i asked you to split it out from #178. the alternative: was SSA-apply chosen over a |
739ad56 to
dfd4fb9
Compare
A ReplicaSet re-adopted as the current version was previously superseded, so it can still carry the removal deadline stamped on it while it drained. This ensures that the annotation is removed via a SSA. Refs #174
dfd4fb9 to
e1fab7a
Compare
|
@lukebond great call out on using the field manager -- using a SSA is cleaner. Patch has been updated. |
|
@darkmuggle i think you misread me! i can't tell what you changed due to the force-push, but what i was saying is not "use SSA and field manager" but rather "given you've used SSA and field manager, it means there is this corner case that needs to be tested; either switch away from SSA to a merge patch and not have to deal with the field manager thing, or otherwise ensure that this corner case is handled". if you reread what i said above in that light, does it make sense? i'm a fan of SSA, i don't really mean to push back on it, and it would inconsistent to be the only bit that doesn't use it, i'm just pointing out that i can't be sure it's correct without somehow demonstrating. even writing a test for it is a lot of boilerplate as it needs to be e2e. |
A ReplicaSet re-adopted as the current version was previously superseded, so it can still carry the removal deadline stamped on it while it drained. Nothing else clears it: the annotation patch on that path uses a different field manager, so server-side apply won't prune it, and cleanup_old_replicasets skips the current version via except_rs.
Left in place, an already-past deadline makes the next rollout tear this version down immediately instead of giving it drainDelaySeconds, stranding whatever is still pinned to it.
Refs #174