mirror of
https://github.com/minio/minio.git
synced 2025-02-04 02:15:59 -05:00
getDisksInfo: Attribute failed disks to correct endpoint (#10360)
If DiskInfo calls failed the information returned was used anyway resulting in no endpoint being set. This would make the drive be attributed to the local system since `disk.Endpoint == disk.DrivePath` in that case. Instead, if the call fails record the endpoint and the error only.
This commit is contained in:
parent
7778fef6bb
commit
1b119557c2
@ -1499,6 +1499,9 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
}
|
}
|
||||||
// add all the disks local to this server.
|
// add all the disks local to this server.
|
||||||
for _, disk := range storageInfo.Disks {
|
for _, disk := range storageInfo.Disks {
|
||||||
|
if disk.DrivePath == "" && disk.Endpoint == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if disk.Endpoint == disk.DrivePath {
|
if disk.Endpoint == disk.DrivePath {
|
||||||
servers[len(servers)-1].Disks = append(servers[len(servers)-1].Disks, disk)
|
servers[len(servers)-1].Disks = append(servers[len(servers)-1].Disks, disk)
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,11 @@ func getDisksInfo(disks []StorageAPI, endpoints []string) (disksInfo []madmin.Di
|
|||||||
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
|
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
|
||||||
logger.LogIf(ctx, err)
|
logger.LogIf(ctx, err)
|
||||||
}
|
}
|
||||||
|
disksInfo[index] = madmin.Disk{
|
||||||
|
State: diskErrToDriveState(err),
|
||||||
|
Endpoint: endpoints[index],
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
di := madmin.Disk{
|
di := madmin.Disk{
|
||||||
Endpoint: endpoints[index],
|
Endpoint: endpoints[index],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user