Files
open-cluster-management/pkg/cmd/hub/placement.go
Jian Qiu e22faa4545 🌱 Build a commonoption for all managers (#228)
* 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>
2023-07-25 03:12:35 +02:00

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
}