Cancellable leader election with channels

This commit is contained in:
Mikhail Mazurskiy
2018-02-12 20:48:53 +11:00
parent 7a6320ef29
commit 1d99fff1ac
4 changed files with 62 additions and 25 deletions

View File

@@ -199,7 +199,7 @@ func Run(c schedulerserverconfig.CompletedConfig, stopCh <-chan struct{}) error
return fmt.Errorf("couldn't create leader elector: %v", err)
}
leaderElector.Run()
leaderElector.Run(stopCh)
return fmt.Errorf("lost lease")
}