Skip to content

Commit

Permalink
Merge pull request #6 from deckhouse/removing-from-balancing-after-delay
Browse files Browse the repository at this point in the history
removing a terminating machine from balancing after some delay
  • Loading branch information
name212 authored May 31, 2024
2 parents 25c0502 + 59f9c40 commit 930c62d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ func (c *controller) reconcileClusterMachine(machine *v1alpha1.Machine) error {
}

if machine.DeletionTimestamp != nil {
c.setExcludeLBLabel(machine)

if c.safetyOptions.DrainDelay.Duration != 0 {
if machine.DeletionTimestamp.Add(c.safetyOptions.DrainDelay.Duration).After(time.Now()) {
klog.Infof("drain delay of %q has not yet passed for machine %q", c.safetyOptions.DrainDelay.Duration.String(), machine.Name)
Expand All @@ -216,6 +214,9 @@ func (c *controller) reconcileClusterMachine(machine *v1alpha1.Machine) error {
}
}

// removing the machine from balancing
c.setExcludeLBLabel(machine)

// Processing of delete event
if err := c.machineDelete(machine, driver); err != nil {
c.enqueueMachineAfter(machine, MachineEnqueueRetryPeriod)
Expand Down

0 comments on commit 930c62d

Please sign in to comment.