From e6eab2091f632622fadbe3b25bb4732125b2d5df Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Sat, 30 Jul 2022 10:51:40 +0530 Subject: [PATCH] fix: Incorrect ServersCount in cluster.info (#15431) The `ServersCount` field in cluster.info is expected to contain the number of nodes, and not number of endpoints. --- cmd/admin-handlers.go | 2 +- cmd/endpoint.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index 47aa089c9..fa17e6ddd 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -2713,7 +2713,7 @@ func appendClusterMetaInfoToZip(ctx context.Context, zipWriter *zip.Writer) { go func() { ci := clusterInfo{} ci.Info.PoolsCount = len(globalEndpoints) - ci.Info.ServersCount = globalEndpoints.NEndpoints() + ci.Info.ServersCount = len(globalEndpoints.Hostnames()) ci.Info.MinioVersion = Version si, _ := objectAPI.StorageInfo(ctx) diff --git a/cmd/endpoint.go b/cmd/endpoint.go index 5e4f80a49..9a1f2ce9b 100644 --- a/cmd/endpoint.go +++ b/cmd/endpoint.go @@ -315,7 +315,7 @@ func (l EndpointServerPools) HTTPS() bool { return l[0].Endpoints.HTTPS() } -// NEndpoints - returns all nodes count +// NEndpoints - returns number of endpoints func (l EndpointServerPools) NEndpoints() (count int) { for _, ep := range l { count += len(ep.Endpoints)