mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-21 05:07:10 +00:00
* support work driver config for cluster manager. Signed-off-by: morvencao <lcao@redhat.com> * address comments. Signed-off-by: morvencao <lcao@redhat.com> --------- Signed-off-by: morvencao <lcao@redhat.com>
30 lines
879 B
Go
30 lines
879 B
Go
package hub
|
|
|
|
import (
|
|
"github.com/spf13/pflag"
|
|
)
|
|
|
|
// WorkHubManagerOptions defines the flags for work hub manager
|
|
type WorkHubManagerOptions struct {
|
|
WorkDriver string
|
|
WorkDriverConfig string
|
|
|
|
CloudEventsClientID string
|
|
}
|
|
|
|
func NewWorkHubManagerOptions() *WorkHubManagerOptions {
|
|
return &WorkHubManagerOptions{
|
|
WorkDriver: "kube",
|
|
}
|
|
}
|
|
|
|
// AddFlags register and binds the default flags
|
|
func (o *WorkHubManagerOptions) AddFlags(fs *pflag.FlagSet) {
|
|
fs.StringVar(&o.WorkDriver, "work-driver",
|
|
o.WorkDriver, "The type of work driver, currently it can be kube, mqtt or grpc")
|
|
fs.StringVar(&o.WorkDriverConfig, "work-driver-config",
|
|
o.WorkDriverConfig, "The config file path of current work driver")
|
|
fs.StringVar(&o.CloudEventsClientID, "cloudevents-client-id",
|
|
o.CloudEventsClientID, "The ID of the cloudevents client when publishing works with cloudevents")
|
|
}
|