mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-19 07:37:40 +00:00
* 🌱 add a verify rule for golang files import order This PR uses the [gci tool](https://github.com/daixiang0/gci) to make all go files' import section with a specific order, it will organize import with group with order: 1. standard library modules 2. 3rd party modules 3. modules in OCM org, like the `open-cluster-management.io/api` 4. current project `open-cluster-management.io/ocm` modules developers can use the `make fmt-imports` to format the import automatically and the `make verify-fmt-imports` to check for any violation. Signed-off-by: zhujian <jiazhu@redhat.com> * 🌱 format the go files import Signed-off-by: zhujian <jiazhu@redhat.com> --------- Signed-off-by: zhujian <jiazhu@redhat.com>
29 lines
1020 B
Go
29 lines
1020 B
Go
package spoke
|
|
|
|
import (
|
|
"github.com/openshift/library-go/pkg/controller/controllercmd"
|
|
"github.com/spf13/cobra"
|
|
|
|
"open-cluster-management.io/ocm/pkg/operator/operators/klusterlet"
|
|
"open-cluster-management.io/ocm/pkg/version"
|
|
)
|
|
|
|
// NewKlusterletOperatorCmd generatee a command to start klusterlet operator
|
|
func NewKlusterletOperatorCmd() *cobra.Command {
|
|
|
|
options := klusterlet.Options{}
|
|
cmdConfig := controllercmd.
|
|
NewControllerCommandConfig("klusterlet", version.Get(), options.RunKlusterletOperator)
|
|
cmd := cmdConfig.NewCommand()
|
|
cmd.Use = "klusterlet"
|
|
cmd.Short = "Start the klusterlet operator"
|
|
|
|
// add disable leader election flag
|
|
cmd.Flags().BoolVar(&cmdConfig.DisableLeaderElection, "disable-leader-election", false, "Disable leader election for the agent.")
|
|
cmd.Flags().BoolVar(&options.SkipPlaceholderHubSecret, "skip-placeholder-hub-secret", false,
|
|
"If set, will skip ensuring a placeholder hub secret which is originally intended for pulling "+
|
|
"work image before approved")
|
|
|
|
return cmd
|
|
}
|