Skip to content

Commit 96bef4c

Browse files
authored
Merge pull request #6331 from allenmunC1/leader-elect-1.27
Backport of #6115 fix: add elect-leader flag to the pflag into 1.27
2 parents 8fbf8ff + fd9f7d5 commit 96bef4c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cluster-autoscaler/main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ func run(healthCheck *metrics.HealthCheck, debuggingSnapshotter debuggingsnapsho
524524

525525
func main() {
526526
klog.InitFlags(nil)
527+
528+
leaderElection := defaultLeaderElectionConfiguration()
529+
leaderElection.LeaderElect = true
530+
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)
531+
527532
featureGate := utilfeature.DefaultMutableFeatureGate
528533
loggingConfig := logsapi.NewLoggingConfiguration()
529534

@@ -541,10 +546,6 @@ func main() {
541546

542547
logs.InitLogs()
543548

544-
leaderElection := defaultLeaderElectionConfiguration()
545-
leaderElection.LeaderElect = true
546-
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)
547-
548549
healthCheck := metrics.NewHealthCheck(*maxInactivityTimeFlag, *maxFailingTimeFlag)
549550

550551
klog.V(1).Infof("Cluster Autoscaler %s", version.ClusterAutoscalerVersion)

0 commit comments

Comments
 (0)