Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: Remove duplicate display of dashboard URLs #2502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, ","))
Copy link
Collaborator

@xhebox xhebox Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a new function that can display multiple dashboard address(dashboard_servers). So it is invalid to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be an if len(dashboardAddrs) > 1 around it instead? And then also a if len(dashboardAddrs) == 1 before line 836 ?

Also, does it use the right scheme if there are multiple?

Copy link
Contributor Author

@dveeden dveeden Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this to check for the length of dashboardAddrs.

PTAL @xhebox

if len(dashboardAddrs) > 1 {
fmt.Printf("Dashboard URLs: %s\n", strings.Join(dashboardAddrs, ","))
}
}

return nil
Expand Down
Loading