info: Populate pool/set/disk indexes for offline disks (#18613)

This can be calculated from the disk layout and some external
applications would like to know the location of the offline
disks.
This commit is contained in:
Anis Eleuch 2023-12-08 08:13:04 -08:00 committed by GitHub
parent b50d90183e
commit aed7a1818a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -975,8 +975,11 @@ func getOfflineDisks(offlineHost string, endpoints EndpointServerPools) []madmin
for _, ep := range pool.Endpoints {
if offlineHost == "" && ep.IsLocal || offlineHost == ep.Host {
offlineDisks = append(offlineDisks, madmin.Disk{
Endpoint: ep.String(),
State: string(madmin.ItemOffline),
Endpoint: ep.String(),
State: string(madmin.ItemOffline),
PoolIndex: ep.PoolIdx,
SetIndex: ep.SetIdx,
DiskIndex: ep.DiskIdx,
})
}
}