Skip to content

Commit

Permalink
daemon/drain.go: bump initial drain sleeps down to 1min
Browse files Browse the repository at this point in the history
  • Loading branch information
kikisdeliveryservice committed Jun 11, 2021
1 parent 4ae1b86 commit 6883ef2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/daemon/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (dn *Daemon) cordonOrUncordonNode(desired bool) error {
}

func (dn *Daemon) drain() error {
failedDrains := 0
done := make(chan bool, 1)

drainer := func() chan error {
Expand All @@ -64,7 +65,12 @@ func (dn *Daemon) drain() error {
default:
if err := drain.RunNodeDrain(dn.drainer, dn.node.Name); err != nil {
glog.Infof("Draining failed with: %v, retrying", err)
time.Sleep(5 * time.Minute)
failedDrains++
if failedDrains > 5 {
time.Sleep(5 * time.Minute)
} else {
time.Sleep(1 * time.Minute)
}
continue
}
close(ret)
Expand Down

0 comments on commit 6883ef2

Please sign in to comment.