forked from openshift/cert-manager-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
40 lines (32 loc) · 802 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
package main
import (
goflag "flag"
"math/rand"
"os"
"time"
"k8s.io/component-base/cli"
utilflag "k8s.io/component-base/cli/flag"
"github.com/openshift/cert-manager-operator/pkg/cmd/operator"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func main() {
rand.Seed(time.Now().UTC().UnixNano())
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
command := NewOperatorCommand()
code := cli.Run(command)
os.Exit(code)
}
func NewOperatorCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "cert-manager-operator",
Short: "OpenShift cluster cert-manager operator",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
os.Exit(1)
},
}
cmd.AddCommand(operator.NewOperator())
return cmd
}