Files
open-cluster-management/pkg/cmd/spoke/agent.go
2020-05-11 15:13:38 +08:00

23 lines
577 B
Go

package spoke
import (
"github.com/spf13/cobra"
"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/open-cluster-management/registration/pkg/spoke"
"github.com/open-cluster-management/registration/pkg/version"
)
func NewAgent() *cobra.Command {
agentOptions := spoke.NewSpokeAgentOptions()
cmd := controllercmd.
NewControllerCommandConfig("registration-agent", version.Get(), agentOptions.RunSpokeAgent).
NewCommand()
cmd.Use = "agent"
cmd.Short = "Start the Cluster Registration Agent"
agentOptions.AddFlags(cmd.Flags())
return cmd
}