Skip to content

Commit

Permalink
Release leader election lock on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mcristina422 authored Mar 12, 2021
1 parent 5d05268 commit 4cf9a98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,11 @@ func main() {
}

leaderelection.RunOrDie(ctx.TODO(), leaderelection.LeaderElectionConfig{
Lock: lock,
LeaseDuration: leaderElection.LeaseDuration.Duration,
RenewDeadline: leaderElection.RenewDeadline.Duration,
RetryPeriod: leaderElection.RetryPeriod.Duration,
Lock: lock,
LeaseDuration: leaderElection.LeaseDuration.Duration,
RenewDeadline: leaderElection.RenewDeadline.Duration,
RetryPeriod: leaderElection.RetryPeriod.Duration,
ReleaseOnCancel: true,
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: func(_ ctx.Context) {
// Since we are committing a suicide after losing
Expand Down

0 comments on commit 4cf9a98

Please sign in to comment.