diff --git a/cmd/training-operator.v1/main.go b/cmd/training-operator.v1/main.go index 4da1d21087..0d5cd145eb 100644 --- a/cmd/training-operator.v1/main.go +++ b/cmd/training-operator.v1/main.go @@ -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 @@ -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") @@ -96,7 +98,7 @@ func main() { Port: monitoringPort, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "1ca428e5.", + LeaderElectionID: leaderElectionID, Namespace: namespace, }) if err != nil {