From 7a03a91ec40803c9adc4261a6e80e9189a4bac74 Mon Sep 17 00:00:00 2001 From: Takao Shibata Date: Mon, 31 Oct 2022 21:49:42 +0900 Subject: [PATCH] feat(cli): add port flag for dashboard command Signed-off-by: Takao Shibata --- pkg/kubectl-argo-rollouts/cmd/dashboard/dashboard.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kubectl-argo-rollouts/cmd/dashboard/dashboard.go b/pkg/kubectl-argo-rollouts/cmd/dashboard/dashboard.go index 3f3cd1687a..f0c720df72 100644 --- a/pkg/kubectl-argo-rollouts/cmd/dashboard/dashboard.go +++ b/pkg/kubectl-argo-rollouts/cmd/dashboard/dashboard.go @@ -10,6 +10,7 @@ import ( func NewCmdDashboard(o *options.ArgoRolloutsOptions) *cobra.Command { var rootPath string + var port int var cmd = &cobra.Command{ Use: "dashboard", Short: "Start UI dashboard", @@ -30,12 +31,13 @@ func NewCmdDashboard(o *options.ArgoRolloutsOptions) *cobra.Command { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) argorollouts := server.NewServer(opts) - argorollouts.Run(ctx, 3100, true) + argorollouts.Run(ctx, port, true) cancel() } }, } cmd.Flags().StringVar(&rootPath, "root-path", "rollouts", "changes the root path of the dashboard") + cmd.Flags().IntVarP(&port, "port", "p", 3100, "port to listen on") return cmd }