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.
This commit is contained in:
Shireesh Anjal 2022-07-30 10:51:40 +05:30 committed by GitHub
parent 3cdb609cca
commit e6eab2091f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -2713,7 +2713,7 @@ func appendClusterMetaInfoToZip(ctx context.Context, zipWriter *zip.Writer) {
go func() { go func() {
ci := clusterInfo{} ci := clusterInfo{}
ci.Info.PoolsCount = len(globalEndpoints) ci.Info.PoolsCount = len(globalEndpoints)
ci.Info.ServersCount = globalEndpoints.NEndpoints() ci.Info.ServersCount = len(globalEndpoints.Hostnames())
ci.Info.MinioVersion = Version ci.Info.MinioVersion = Version
si, _ := objectAPI.StorageInfo(ctx) si, _ := objectAPI.StorageInfo(ctx)

View File

@ -315,7 +315,7 @@ func (l EndpointServerPools) HTTPS() bool {
return l[0].Endpoints.HTTPS() return l[0].Endpoints.HTTPS()
} }
// NEndpoints - returns all nodes count // NEndpoints - returns number of endpoints
func (l EndpointServerPools) NEndpoints() (count int) { func (l EndpointServerPools) NEndpoints() (count int) {
for _, ep := range l { for _, ep := range l {
count += len(ep.Endpoints) count += len(ep.Endpoints)