Skip to content

Commit

Permalink
add elect-leader flag to the pflag
Browse files Browse the repository at this point in the history
  • Loading branch information
aagusuab committed Sep 15, 2023
1 parent 1a6b1e9 commit 6cf4129
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 @@ -550,6 +550,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 @@ -567,10 +572,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 6cf4129

Please sign in to comment.