Update madmin-go to 2.1.1 (#2810)
Update madmin-go library + github.com/minio/mc Also update the code to work with the library update Co-authored-by: Anis Elleuch <anis@min.io>
This commit is contained in:
@@ -73,34 +73,11 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) {
|
||||
// we are trimming uint64 to int64 this will report an incorrect measurement for numbers greater than
|
||||
// 9,223,372,036,854,775,807
|
||||
|
||||
var backendType string
|
||||
var rrSCParity float64
|
||||
var standardSCParity float64
|
||||
var onlineDrives float64
|
||||
var offlineDrives float64
|
||||
|
||||
if v, success := serverInfo.Backend.(map[string]interface{}); success {
|
||||
bt, ok := v["backendType"]
|
||||
if ok {
|
||||
backendType = bt.(string)
|
||||
}
|
||||
rp, ok := v["rrSCParity"]
|
||||
if ok {
|
||||
rrSCParity = rp.(float64)
|
||||
}
|
||||
sp, ok := v["standardSCParity"]
|
||||
if ok {
|
||||
standardSCParity = sp.(float64)
|
||||
}
|
||||
onDrives, ok := v["onlineDisks"]
|
||||
if ok {
|
||||
onlineDrives = onDrives.(float64)
|
||||
}
|
||||
offDrives, ok := v["offlineDisks"]
|
||||
if ok {
|
||||
offlineDrives = offDrives.(float64)
|
||||
}
|
||||
}
|
||||
backendType := serverInfo.Backend.Type
|
||||
rrSCParity := serverInfo.Backend.RRSCParity
|
||||
standardSCParity := serverInfo.Backend.StandardSCParity
|
||||
onlineDrives := serverInfo.Backend.OnlineDisks
|
||||
offlineDrives := serverInfo.Backend.OfflineDisks
|
||||
|
||||
var usedSpace int64
|
||||
// serverArray contains the serverProperties which describe the servers in the network
|
||||
@@ -139,7 +116,7 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) {
|
||||
}
|
||||
|
||||
backendData := &models.BackendProperties{
|
||||
BackendType: backendType,
|
||||
BackendType: string(backendType),
|
||||
RrSCParity: int64(rrSCParity),
|
||||
StandardSCParity: int64(standardSCParity),
|
||||
OnlineDrives: int64(onlineDrives),
|
||||
|
||||
@@ -49,11 +49,7 @@ func (suite *AdminInfoTestSuite) SetupSuite() {
|
||||
Servers: []madmin.ServerProperties{{
|
||||
Disks: []madmin.Disk{{}},
|
||||
}},
|
||||
Backend: map[string]interface{}{
|
||||
"backendType": "mock",
|
||||
"rrSCParity": 0.0,
|
||||
"standardSCParity": 0.0,
|
||||
},
|
||||
Backend: madmin.ErasureBackend{Type: "mock"},
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user