mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
server-info: Return initializing state properly (#17070)
This commit is contained in:
@@ -883,11 +883,13 @@ func (sys *NotificationSys) GetProcInfo(ctx context.Context) []madmin.ProcInfo {
|
||||
return reply
|
||||
}
|
||||
|
||||
// Construct a list of offline disks information for a given node.
|
||||
// If offlineHost is empty, do it for the local disks.
|
||||
func getOfflineDisks(offlineHost string, endpoints EndpointServerPools) []madmin.Disk {
|
||||
var offlineDisks []madmin.Disk
|
||||
for _, pool := range endpoints {
|
||||
for _, ep := range pool.Endpoints {
|
||||
if offlineHost == ep.Host {
|
||||
if offlineHost == "" && ep.IsLocal || offlineHost == ep.Host {
|
||||
offlineDisks = append(offlineDisks, madmin.Disk{
|
||||
Endpoint: ep.String(),
|
||||
State: string(madmin.ItemOffline),
|
||||
@@ -947,8 +949,6 @@ func (sys *NotificationSys) ServerInfo() []madmin.ServerProperties {
|
||||
info.Endpoint = client.host.String()
|
||||
info.State = string(madmin.ItemOffline)
|
||||
info.Disks = getOfflineDisks(info.Endpoint, globalEndpoints)
|
||||
} else {
|
||||
info.State = string(madmin.ItemOnline)
|
||||
}
|
||||
reply[idx] = info
|
||||
}(client, i)
|
||||
|
||||
Reference in New Issue
Block a user