Skip to content

Commit c034f1f

Browse files
committed
Add note about exiting on leader loss
1 parent 7fa750f commit c034f1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/manager/internal.go

+3
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ func (cm *controllerManager) Start(stop <-chan struct{}) error {
162162
Callbacks: leaderelection.LeaderCallbacks{
163163
OnStartedLeading: cm.start,
164164
OnStoppedLeading: func() {
165+
// Most implementations of leader election log.Fatal() here.
166+
// Since Start is wrapped in log.Fatal when called, we can just return
167+
// an error here which will cause the program to exit.
165168
cm.errChan <- fmt.Errorf("leader election lost")
166169
},
167170
},

0 commit comments

Comments
 (0)