[rel-v0.62] Fix bug where manageMachinePreservation uncordons nodes of Running Machines unconditionally#1108
Draft
thiyyakat wants to merge 4 commits into
Draft
Conversation
When stopping preservation on a machine with a backing node, uncordon the node only when the machine phase is MachineRunning. This step is ordered before clearMachinePreserveExpiryTime so that a failed uncordon retries on the next reconcile with PreserveExpiryTime still set.
…d uncordon - Add an early-exit in manageMachinePreservation when the machine is neither preserved (PreserveExpiryTime == nil) nor annotated. This avoids unnecessary work on machines unrelated to preservation. - Remove the uncordon call at the end of the function. Uncordoning is now done inside stopPreservationIfActive, gated on MachineRunning.
- Extend manageMachinePreservation test matrix with nodeUnschedulable in setup/expect to verify node cordon state after preservation actions. - Add cases: preserved machine recovers to Running (uncordoned), preservation expires while Running (uncordoned + annotation removed), externally-cordoned Running machine with no preservation (node left cordoned), preserved Failed machine (node left cordoned). - Fix existing preservation-start entries to expect nodeUnschedulable=true since drain cordon the node as part of the preservation flow.
- Add tests to verify that a cordoned node is left untouched when the machine has no preservation annotations, and that actively-preserved machines keep their node cordoned regardless of which annotation drives preservation. - It block verifies that manageMachinePreservation performs no writes at all (status, annotations, labels, spec, node) for a machine with no preservation state.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The previous implementation called uncordonNodeIfCordoned whenever IsMachineActive returned true and a node name was present. This meant any Running machine with a cordoned backing node (cordoned for reasons unrelated to preservation, e.g: CA scale-down) would be unconditionally uncordoned on every reconcile pass.
The PR fixes this by:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The following tests were added:
Release note: