Add PoolNumber field to madmin.ServerProperties (#11327)

This commit is contained in:
Bala FA
2021-03-01 10:56:28 +05:30
committed by GitHub
parent e3f8830ab7
commit 23f7ab40b3
2 changed files with 23 additions and 7 deletions

View File

@@ -1239,6 +1239,21 @@ func (sys *NotificationSys) ServerInfo() []madmin.ServerProperties {
}(client, i)
}
wg.Wait()
for i := range reply {
for j := range globalEndpoints {
for _, endpoint := range globalEndpoints[j].Endpoints {
if reply[i].Endpoint == endpoint.Host {
reply[i].PoolNumber = j + 1
} else if host, err := xnet.ParseHost(reply[i].Endpoint); err == nil {
if host.Name == endpoint.Hostname() {
reply[i].PoolNumber = j + 1
}
}
}
}
}
return reply
}