Skip to content

Commit

Permalink
Fix the default LeaderElectionID and make it an argument (#1639)
Browse files Browse the repository at this point in the history
  • Loading branch information
goyalankit authored Jul 28, 2022
1 parent 9cc1cc9 commit 32db9b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/training-operator.v1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func init() {
func main() {
var metricsAddr string
var enableLeaderElection bool
var leaderElectionID string
var probeAddr string
var enabledSchemes controllerv1.EnabledSchemes
var enableGangScheduling bool
Expand All @@ -62,6 +63,7 @@ func main() {
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.StringVar(&leaderElectionID, "leader-election-id", "1ca428e5.training-operator.kubeflow.org", "The ID for leader election.")
flag.Var(&enabledSchemes, "enable-scheme", "Enable scheme(s) as --enable-scheme=tfjob --enable-scheme=pytorchjob, case insensitive."+
" Now supporting TFJob, PyTorchJob, MXNetJob, XGBoostJob. By default, all supported schemes will be enabled.")
flag.BoolVar(&enableGangScheduling, "enable-gang-scheduling", false, "Set true to enable gang scheduling")
Expand Down Expand Up @@ -96,7 +98,7 @@ func main() {
Port: monitoringPort,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "1ca428e5.",
LeaderElectionID: leaderElectionID,
Namespace: namespace,
})
if err != nil {
Expand Down

0 comments on commit 32db9b9

Please sign in to comment.