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

@@ -204,7 +204,7 @@ func Run(c *config.CompletedConfig) error {
glog.Fatalf("error creating lock: %v", err)
}
leaderelection.RunOrDie(leaderelection.LeaderElectionConfig{
leaderelection.RunOrDie(wait.NeverStop, leaderelection.LeaderElectionConfig{
Lock: rl,
LeaseDuration: c.ComponentConfig.GenericComponent.LeaderElection.LeaseDuration.Duration,
RenewDeadline: c.ComponentConfig.GenericComponent.LeaderElection.RenewDeadline.Duration,