Skip to content

Commit 147d3f0

Browse files
bertinattojacobsee
authored andcommitted
UPSTREAM: <drop>: test integration failure
1 parent 78dfcec commit 147d3f0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/kube-controller-manager/app/controllermanager.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ func Run(ctx context.Context, c *config.CompletedConfig, stopCh2 <-chan struct{}
438438
case <-stopCh:
439439
// We were asked to terminate. Exit 0.
440440
klog.Info("Requested to terminate. Exiting.")
441-
os.Exit(0)
441+
if !utilfeature.DefaultFeatureGate.Enabled(cmfeatures.ControllerManagerReleaseLeaderElectionLockOnExit) {
442+
os.Exit(0)
443+
}
442444
default:
443445
// We lost the lock.
444446
logger.Error(nil, "leaderelection lost/stopped")
@@ -477,7 +479,9 @@ func Run(ctx context.Context, c *config.CompletedConfig, stopCh2 <-chan struct{}
477479
case <-stopCh:
478480
// We were asked to terminate. Exit 0.
479481
klog.Info("Requested to terminate. Exiting.")
480-
os.Exit(0)
482+
if !utilfeature.DefaultFeatureGate.Enabled(cmfeatures.ControllerManagerReleaseLeaderElectionLockOnExit) {
483+
os.Exit(0)
484+
}
481485
default:
482486
// We lost the lock.
483487
logger.Error(nil, "migration leaderelection lost/stopped")

0 commit comments

Comments
 (0)