Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #786 from charleszheng44/manager-version
Browse files Browse the repository at this point in the history
[VC] add version option for vc-manager
  • Loading branch information
k8s-ci-robot authored Jun 3, 2020
2 parents f29f96e + 6c9c27f commit 3ab5cfb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions incubator/virtualcluster/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (

logrutil "sigs.k8s.io/multi-tenancy/incubator/virtualcluster/pkg/controller/util/logr"
vcmanager "sigs.k8s.io/multi-tenancy/incubator/virtualcluster/pkg/controller/vcmanager"
"sigs.k8s.io/multi-tenancy/incubator/virtualcluster/pkg/version"
"sigs.k8s.io/multi-tenancy/incubator/virtualcluster/pkg/version/verflag"
)

func main() {
Expand All @@ -42,15 +44,24 @@ func main() {
leaderElection bool
leaderElectionCmName string
maxConcurrentReconciles int
versionOpt bool
)
flag.StringVar(&metricsAddr, "metrics-addr", ":0", "The address the metric endpoint binds to.")
flag.StringVar(&masterProvisioner, "master-prov", "native", "The underlying platform that will provision master for virtualcluster.")
flag.BoolVar(&leaderElection, "leader-election", true, "If enable leaderelection for vc-manager")
flag.StringVar(&leaderElectionCmName, "le-cm-name", "vc-manager-leaderelection-lock", "The name of the configmap that will be used as the resourcelook for leaderelection")
flag.IntVar(&maxConcurrentReconciles, "num-reconciles", 10, "The max number reconcilers of virtualcluster controller")
flag.StringVar(&logFile, "log-file", "", "The path of the logfile, if not set, only log to the stderr")
flag.BoolVar(&versionOpt, "version", false, "Print the version information")

flag.Parse()

// print version information
if versionOpt {
fmt.Printf("VirtualCluster %s\n", verflag.GetVersion(version.Get()))
os.Exit(0)
}

loggr, err := logrutil.NewLoggerToFile(logFile)
if err != nil {
panic(fmt.Sprintf("fail to initialize logr: %s", err))
Expand Down

0 comments on commit 3ab5cfb

Please sign in to comment.