Skip to content

Commit 83af400

Browse files
committed
Bugfix: Removed bug while draining nodes
The drain nodes logic was reading an older version of the object while making drain call, there by fetching the wrong last operation timestamp. This lead to forceful draining of nodes. This was fixed by updating the updateMachineStatus method to return the new object instead of the old one.
1 parent 03e2631 commit 83af400

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/machine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ func (c *controller) updateMachineStatus(
518518
if err != nil {
519519
// Keep retrying until update goes through
520520
glog.V(3).Infof("Warning: Updated failed, retrying, error: %q", err)
521-
c.updateMachineStatus(machine, lastOperation, currentStatus)
521+
return c.updateMachineStatus(machine, lastOperation, currentStatus)
522522
}
523-
return machine, nil
523+
return clone, nil
524524
}
525525

526526
func (c *controller) updateMachineConditions(machine *v1alpha1.Machine, conditions []v1.NodeCondition) *v1alpha1.Machine {

0 commit comments

Comments
 (0)