We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4276f38 commit 3f9a825Copy full SHA for 3f9a825
pkg/manager/internal.go
@@ -309,7 +309,16 @@ func (cm *controllerManager) startLeaderElection() (err error) {
309
return err
310
}
311
312
+ ctx, cancel := context.WithCancel(context.Background())
313
+ go func() {
314
+ select {
315
+ case <-cm.internalStop:
316
+ cancel()
317
+ case <-ctx.Done():
318
+ }
319
+ }()
320
+
321
// Start the leader elector process
- go l.Run(context.Background())
322
+ go l.Run(ctx)
323
return nil
324
0 commit comments