mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-21 08:33:49 +00:00
* Build a commonoption for all managers Signed-off-by: Jian Qiu <jqiu@redhat.com> * Add unit tests Signed-off-by: Jian Qiu <jqiu@redhat.com> --------- Signed-off-by: Jian Qiu <jqiu@redhat.com>
26 lines
640 B
Go
26 lines
640 B
Go
package hub
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
|
controllers "open-cluster-management.io/ocm/pkg/placement/controllers"
|
|
"open-cluster-management.io/ocm/pkg/version"
|
|
)
|
|
|
|
func NewPlacementController() *cobra.Command {
|
|
opts := commonoptions.NewOptions()
|
|
cmdConfig := opts.
|
|
NewControllerCommandConfig("placement", version.Get(), controllers.RunControllerManager)
|
|
cmd := cmdConfig.NewCommandWithContext(context.TODO())
|
|
cmd.Use = "controller"
|
|
cmd.Short = "Start the Placement Scheduling Controller"
|
|
|
|
flags := cmd.Flags()
|
|
opts.AddFlags(flags)
|
|
|
|
return cmd
|
|
}
|