mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-11 11:48:33 +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>
24 lines
597 B
Go
24 lines
597 B
Go
package hub
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
|
"open-cluster-management.io/ocm/pkg/version"
|
|
"open-cluster-management.io/ocm/pkg/work/hub"
|
|
)
|
|
|
|
// NewHubManager generates a command to start hub manager
|
|
func NewWorkController() *cobra.Command {
|
|
opts := commonoptions.NewOptions()
|
|
cmdConfig := opts.
|
|
NewControllerCommandConfig("work-manager", version.Get(), hub.RunWorkHubManager)
|
|
cmd := cmdConfig.NewCommandWithContext(context.TODO())
|
|
cmd.Use = "manager"
|
|
cmd.Short = "Start the Work Hub Manager"
|
|
|
|
return cmd
|
|
}
|