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.
2 parents d708e3d + 3f9a825 commit 056a18aCopy full SHA for 056a18a
pkg/manager/internal.go
@@ -361,7 +361,16 @@ func (cm *controllerManager) startLeaderElection() (err error) {
361
return err
362
}
363
364
+ ctx, cancel := context.WithCancel(context.Background())
365
+ go func() {
366
+ select {
367
+ case <-cm.internalStop:
368
+ cancel()
369
+ case <-ctx.Done():
370
+ }
371
+ }()
372
+
373
// Start the leader elector process
- go l.Run(context.Background())
374
+ go l.Run(ctx)
375
return nil
376
0 commit comments