mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-17 22:58:53 +00:00
Add disable leader election flag (#109)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
This commit is contained in:
@@ -24,6 +24,7 @@ spec:
|
||||
- "agent"
|
||||
- "--spoke-cluster-name=cluster1"
|
||||
- "--hub-kubeconfig=/spoke/hub-kubeconfig/kubeconfig"
|
||||
- "--disable-leader-election"
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
|
||||
@@ -12,12 +12,17 @@ import (
|
||||
// NewWorkloadAgent generates a command to start workload agent
|
||||
func NewWorkloadAgent() *cobra.Command {
|
||||
o := spoke.NewWorkloadAgentOptions()
|
||||
cmd := controllercmd.
|
||||
NewControllerCommandConfig("work-agent", version.Get(), o.RunWorkloadAgent).
|
||||
NewCommand()
|
||||
cmdConfig := controllercmd.
|
||||
NewControllerCommandConfig("work-agent", version.Get(), o.RunWorkloadAgent)
|
||||
cmd := cmdConfig.NewCommand()
|
||||
cmd.Use = "agent"
|
||||
cmd.Short = "Start the Cluster Registration Agent"
|
||||
|
||||
o.AddFlags(cmd)
|
||||
|
||||
// add disable leader election flag
|
||||
flags := cmd.Flags()
|
||||
flags.BoolVar(&cmdConfig.DisableLeaderElection, "disable-leader-election", false, "Disable leader election for the agent.")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user