Skip to content

Commit

Permalink
Add skip wait for delete timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Demichev committed Jan 29, 2020
1 parent f0c52c1 commit c99f27b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controller/machine/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const (

// Machine has a deletion timestamp
phaseDeleting = "Deleting"

skipWaitForDeleteTimeoutSeconds = 60 * 5
)

var DefaultActuator Actuator
Expand Down Expand Up @@ -344,6 +346,12 @@ func (r *ReconcileMachine) drainNode(machine *machinev1.Machine) error {
DryRun: false,
}

for _, condition := range node.Status.Conditions {
if condition.Type == corev1.NodeReady && condition.Status == corev1.ConditionUnknown {
drainer.SkipWaitForDeleteTimeoutSeconds = skipWaitForDeleteTimeoutSeconds
}
}

if err := drain.RunCordonOrUncordon(drainer, node, true); err != nil {
// Can't cordon a node
klog.Warningf("cordon failed for node %q: %v", node.Name, err)
Expand Down

0 comments on commit c99f27b

Please sign in to comment.