mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-20 16:14:23 +00:00
Some checks failed
Post / coverage (push) Failing after 26m38s
Post / images (amd64) (push) Failing after 6m59s
Post / images (arm64) (push) Failing after 7m2s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m53s
Close stale issues and PRs / stale (push) Successful in 26s
Signed-off-by: xuezhaojun <zxue@redhat.com>
51 lines
974 B
Go
51 lines
974 B
Go
package main
|
|
|
|
import (
|
|
goflag "flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/pflag"
|
|
utilflag "k8s.io/component-base/cli/flag"
|
|
"k8s.io/component-base/logs"
|
|
|
|
"open-cluster-management.io/ocm/pkg/cmd/hub"
|
|
"open-cluster-management.io/ocm/pkg/version"
|
|
)
|
|
|
|
func main() {
|
|
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
|
|
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
|
|
|
|
logs.AddFlags(pflag.CommandLine)
|
|
logs.InitLogs()
|
|
defer logs.FlushLogs()
|
|
|
|
command := newAddonCommand()
|
|
if err := command.Execute(); err != nil {
|
|
fmt.Fprintf(os.Stderr, "%v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func newAddonCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "addon",
|
|
Short: "Manager of Addon",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
_ = cmd.Help()
|
|
os.Exit(1)
|
|
},
|
|
}
|
|
|
|
if v := version.Get().String(); len(v) == 0 {
|
|
cmd.Version = "<unknown>"
|
|
} else {
|
|
cmd.Version = v
|
|
}
|
|
|
|
cmd.AddCommand(hub.NewAddonManager())
|
|
return cmd
|
|
}
|