From 1a04e94fc179d480a0578b19c1318c0170739fcb Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Thu, 20 Aug 2020 17:52:25 -0500 Subject: [PATCH] Remove clusterID and default name to ID --- api.go | 8 +++----- http/handler.go | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/api.go b/api.go index 232a510e8..018eb8091 100644 --- a/api.go +++ b/api.go @@ -1739,13 +1739,11 @@ func (api *API) State() string { return api.cluster.State() } -// ClusterID returns the cluster ID. -func (api *API) ClusterID() string { - return api.cluster.id -} - // ClusterName returns the cluster name. func (api *API) ClusterName() string { + if api.cluster.Name == "" { + return api.cluster.id + } return api.cluster.Name } diff --git a/http/handler.go b/http/handler.go index 6f08664a4..63e51ef6d 100644 --- a/http/handler.go +++ b/http/handler.go @@ -704,7 +704,6 @@ func (h *Handler) handleGetStatus(w http.ResponseWriter, r *http.Request) { Nodes: h.api.Hosts(r.Context()), NodeStates: h.api.HostStates(r.Context()), LocalID: h.api.Node().ID, - ClusterID: h.api.ClusterID(), ClusterName: h.api.ClusterName(), } w.Header().Set("Content-Type", "application/json") @@ -765,7 +764,6 @@ type getStatusResponse struct { Nodes []*pilosa.Node `json:"nodes"` NodeStates map[string]string `json:"nodeStates"` LocalID string `json:"localID"` - ClusterID string `json:"clusterID"` ClusterName string `json:"clusterName"` }