mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
fix: calculate prometheus disks_offline/disks_total correctly (#11215)
fixes #11196
This commit is contained in:
@@ -216,24 +216,9 @@ func getStorageInfo(disks []StorageAPI, endpoints []string) (StorageInfo, []erro
|
||||
}
|
||||
|
||||
// StorageInfo - returns underlying storage statistics.
|
||||
func (er erasureObjects) StorageInfo(ctx context.Context, local bool) (StorageInfo, []error) {
|
||||
func (er erasureObjects) StorageInfo(ctx context.Context) (StorageInfo, []error) {
|
||||
disks := er.getDisks()
|
||||
endpoints := er.getEndpoints()
|
||||
if local {
|
||||
var localDisks []StorageAPI
|
||||
var localEndpoints []string
|
||||
for i, disk := range disks {
|
||||
if disk != nil {
|
||||
if disk.IsLocal() {
|
||||
// Append this local disk since local flag is true
|
||||
localDisks = append(localDisks, disk)
|
||||
localEndpoints = append(localEndpoints, endpoints[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
disks = localDisks
|
||||
endpoints = localEndpoints
|
||||
}
|
||||
return getStorageInfo(disks, endpoints)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user