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 authored and Jigish Patel committed Feb 6, 2024
1 parent 21e7703 commit ebaf355
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 @@ -486,6 +486,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 @@ -503,10 +508,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 ebaf355

Please sign in to comment.