Skip to content

Commit

Permalink
cluster: Show 'Dashboard URL' or 'Dashboard URLs', but not both
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Jan 22, 2025
1 parent 0791a28 commit 949dfa5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/cluster/manager/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ func (m *Manager) displayDashboards(ctx context.Context, t *spec.Specification,
}
if m.logger.GetDisplayMode() == logprinter.DisplayModeJSON && j != nil {
j.ClusterMetaInfo.DashboardURL = fmt.Sprintf("%s://%s/dashboard", scheme, addr)
} else {
} else if len(dashboardAddrs) == 1 {
fmt.Printf("Dashboard URL: %s\n", color.CyanString("%s://%s/dashboard", scheme, addr))
}
}
Expand All @@ -845,7 +845,9 @@ func (m *Manager) displayDashboards(ctx context.Context, t *spec.Specification,
}

if m.logger.GetDisplayMode() != logprinter.DisplayModeJSON || j == nil {
fmt.Printf("Dashboard URLs: %s\n", strings.Join(dashboardAddrs, ","))
if len(dashboardAddrs) > 1 {
fmt.Printf("Dashboard URLs: %s\n", strings.Join(dashboardAddrs, ","))
}
}

return nil
Expand Down

0 comments on commit 949dfa5

Please sign in to comment.