Skip to content

Commit

Permalink
Merge pull request #6330 from allenmunC1/leader-elect-1.28
Browse files Browse the repository at this point in the history
Backport of #6115 fix: add elect-leader flag to the pflag into 1.28
  • Loading branch information
k8s-ci-robot authored Dec 1, 2023
2 parents 2f1151d + a507e53 commit 025ca9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ func run(healthCheck *metrics.HealthCheck, debuggingSnapshotter debuggingsnapsho

func main() {
klog.InitFlags(nil)

leaderElection := defaultLeaderElectionConfiguration()
leaderElection.LeaderElect = true
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)

featureGate := utilfeature.DefaultMutableFeatureGate
loggingConfig := logsapi.NewLoggingConfiguration()

Expand All @@ -560,10 +565,6 @@ func main() {

logs.InitLogs()

leaderElection := defaultLeaderElectionConfiguration()
leaderElection.LeaderElect = true
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)

healthCheck := metrics.NewHealthCheck(*maxInactivityTimeFlag, *maxFailingTimeFlag)

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

0 comments on commit 025ca9f

Please sign in to comment.