Skip to content

Commit

Permalink
🐛 prevent leader election when shutting down a non-elected manager
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandremahdhaoui committed Mar 23, 2024
1 parent e08b286 commit 49681ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/manager/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ func (cm *controllerManager) engageStopProcedure(stopComplete <-chan struct{}) e

// Stop all the leader election runnables, which includes reconcilers.
cm.logger.Info("Stopping and waiting for leader election runnables")
// Prevent leader election when shutting down a non-elected manager
cm.runnables.LeaderElection.startOnce.Do(func() {})
cm.runnables.LeaderElection.StopAndWait(cm.shutdownCtx)

// Stop the caches before the leader election runnables, this is an important
Expand Down

0 comments on commit 49681ff

Please sign in to comment.