mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-06 01:07:03 +00:00
27 lines
732 B
Go
27 lines
732 B
Go
package spoke
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/openshift/library-go/pkg/controller/controllercmd"
|
|
|
|
"open-cluster-management.io/ocm/pkg/registration/spoke"
|
|
"open-cluster-management.io/ocm/pkg/version"
|
|
)
|
|
|
|
func NewRegistrationAgent() *cobra.Command {
|
|
agentOptions := spoke.NewSpokeAgentOptions()
|
|
cmdConfig := controllercmd.
|
|
NewControllerCommandConfig("registration-agent", version.Get(), agentOptions.RunSpokeAgent)
|
|
|
|
cmd := cmdConfig.NewCommand()
|
|
cmd.Use = "agent"
|
|
cmd.Short = "Start the Cluster Registration Agent"
|
|
|
|
flags := cmd.Flags()
|
|
agentOptions.AddFlags(flags)
|
|
|
|
flags.BoolVar(&cmdConfig.DisableLeaderElection, "disable-leader-election", false, "Disable leader election for the agent.")
|
|
return cmd
|
|
}
|