Skip to content

Commit

Permalink
fix(cli): pass clientOpts to dashboard command
Browse files Browse the repository at this point in the history
Signed-off-by: mikutas <[email protected]>
  • Loading branch information
mikutas committed Nov 23, 2023
1 parent 1600c03 commit e02723f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/argocd/commands/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ $ argocd admin initial-password reset
command.AddCommand(NewRepoCommand())
command.AddCommand(NewImportCommand())
command.AddCommand(NewExportCommand())
command.AddCommand(NewDashboardCommand())
command.AddCommand(NewDashboardCommand(clientOpts))
command.AddCommand(NewNotificationsCommand())
command.AddCommand(NewInitialPasswordCommand())

Expand Down
5 changes: 3 additions & 2 deletions cmd/argocd/commands/admin/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/argoproj/argo-cd/v2/util/errors"
)

func NewDashboardCommand() *cobra.Command {
func NewDashboardCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var (
port int
address string
Expand All @@ -28,7 +28,8 @@ func NewDashboardCommand() *cobra.Command {

compression, err := cache.CompressionTypeFromString(compressionStr)
errors.CheckError(err)
errors.CheckError(headless.MaybeStartLocalServer(ctx, &argocdclient.ClientOptions{Core: true}, initialize.RetrieveContextIfChanged(cmd.Flag("context")), &port, &address, compression))
clientOpts.Core = true
errors.CheckError(headless.MaybeStartLocalServer(ctx, clientOpts, initialize.RetrieveContextIfChanged(cmd.Flag("context")), &port, &address, compression))
println(fmt.Sprintf("Argo CD UI is available at http://%s:%d", address, port))
<-ctx.Done()
},
Expand Down

0 comments on commit e02723f

Please sign in to comment.