Skip to content

Commit

Permalink
feat: add print version flag to rollouts-controller (#1149)
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
huikang authored May 10, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 32d37d8 commit 92e2aab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/rollouts-controller/main.go
Original file line number Diff line number Diff line change
@@ -64,11 +64,16 @@ func newCommand() *cobra.Command {
nginxIngressClasses []string
albVerifyWeight bool
namespaced bool
printVersion bool
)
var command = cobra.Command{
Use: cliName,
Short: "argo-rollouts is a controller to operate on rollout CRD",
RunE: func(c *cobra.Command, args []string) error {
if printVersion {
fmt.Println(version.GetVersion())
return nil
}
setLogLevel(logLevel)
formatter := &log.TextFormatter{
FullTimestamp: true,
@@ -198,6 +203,7 @@ func newCommand() *cobra.Command {
command.Flags().StringArrayVar(&albIngressClasses, "alb-ingress-classes", defaultALBIngressClass, "Defines all the ingress class annotations that the alb ingress controller operates on. Defaults to alb")
command.Flags().StringArrayVar(&nginxIngressClasses, "nginx-ingress-classes", defaultNGINXIngressClass, "Defines all the ingress class annotations that the nginx ingress controller operates on. Defaults to nginx")
command.Flags().BoolVar(&albVerifyWeight, "alb-verify-weight", false, "Verify ALB target group weights before progressing through steps (requires AWS privileges)")
command.Flags().BoolVar(&printVersion, "version", false, "Print version")
return &command
}

0 comments on commit 92e2aab

Please sign in to comment.