-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.go
42 lines (33 loc) · 912 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"os"
"github.com/spf13/cobra"
"k8s.io/component-base/cli"
"github.com/openshift/alibaba-disk-csi-driver-operator/pkg/operator"
"github.com/openshift/alibaba-disk-csi-driver-operator/pkg/version"
"github.com/openshift/library-go/pkg/controller/controllercmd"
)
func main() {
command := NewOperatorCommand()
code := cli.Run(command)
os.Exit(code)
}
func NewOperatorCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "alibaba-disk-csi-driver-operator",
Short: "OpenShift Alibaba Disk CSI Driver Operator",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
os.Exit(1)
},
}
ctrlCmd := controllercmd.NewControllerCommandConfig(
"alibaba-disk-csi-driver-operator",
version.Get(),
operator.RunOperator,
).NewCommand()
ctrlCmd.Use = "start"
ctrlCmd.Short = "Start the Alibaba Disk CSI Driver Operator"
cmd.AddCommand(ctrlCmd)
return cmd
}