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

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Jan 21, 2025

What problem does this PR solve?

Note the two lines with Dashboard URL here:

$ tiup cluster display dvetest1 
Cluster type:       tidb
Cluster name:       dvetest1
Cluster version:    v8.5.0
Deploy user:        tidb
SSH type:           builtin
Dashboard URL:      http://192.168.122.196:2379/dashboard
Dashboard URLs:     http://192.168.122.196:2379/dashboard
Grafana URL:        http://192.168.122.196:3000
ID                     Role        Host             Ports        OS/Arch       Status   Data Dir                    Deploy Dir
--                     ----        ----             -----        -------       ------   --------                    ----------
192.168.122.196:3000   grafana     192.168.122.196  3000         linux/x86_64  Up       -                           /tidb-deploy/grafana-3000
192.168.122.196:2379   pd          192.168.122.196  2379/2380    linux/x86_64  Up|L|UI  /tidb-data/pd-2379          /tidb-deploy/pd-2379
192.168.122.196:9090   prometheus  192.168.122.196  9090/12020   linux/x86_64  Up       /tidb-data/prometheus-9090  /tidb-deploy/prometheus-9090
192.168.122.196:4000   tidb        192.168.122.196  4000/10080   linux/x86_64  Up       -                           /tidb-deploy/tidb-4000
192.168.122.196:20160  tikv        192.168.122.196  20160/20180  linux/x86_64  Up       /tidb-data/tikv-20160       /tidb-deploy/tikv-20160
Total nodes: 5

Related: #2472

What is changed and how it works?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Now only one line in the output: Dashboard URL: http://192.168.122.196:2379/dashboard

Release notes:

NONE

Copy link
Contributor

ti-chi-bot bot commented Jan 21, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xhebox for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot requested a review from srstack January 21, 2025 11:05
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 21, 2025
@dveeden
Copy link
Contributor Author

dveeden commented Jan 21, 2025

/cc @xhebox

@ti-chi-bot ti-chi-bot bot requested a review from xhebox January 21, 2025 11:06
@@ -844,9 +844,5 @@ 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

@dveeden dveeden force-pushed the cluster_display_dashboard_urls branch from 7e2a86e to 949dfa5 Compare January 22, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants