Skip to content

Commit

Permalink
cluster: fix getClusterID() type (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar authored Oct 11, 2021
1 parent 75cc31e commit bd92867
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/cluster/api/pdapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,6 @@ func (pc *PDClient) GetConfig() (map[string]interface{}, error) {
// GetClusterID return cluster ID
func (pc *PDClient) GetClusterID() (string, error) {
endpoints := pc.getEndpoints(pdClusterIDURI)

// We don't use the `github.com/tikv/pd/server/config` directly because
// there is compatible issue: https://github.com/pingcap/tiup/issues/637
clusterID := map[string]interface{}{}

_, err := tryURLs(endpoints, func(endpoint string) ([]byte, error) {
Expand All @@ -347,7 +344,7 @@ func (pc *PDClient) GetClusterID() (string, error) {
return "", err
}

return clusterID["id"].(string), nil
return fmt.Sprintf("%.0f", clusterID["id"]), nil
}

// GetDashboardAddress get the PD node address which runs dashboard
Expand Down

0 comments on commit bd92867

Please sign in to comment.