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:
4
go.mod
4
go.mod
@@ -22,8 +22,8 @@ require (
|
||||
github.com/minio/directpv v1.4.4-0.20220805090942-948ca4731651
|
||||
github.com/minio/highwayhash v1.0.2
|
||||
github.com/minio/kes v0.22.3
|
||||
github.com/minio/madmin-go/v2 v2.0.20
|
||||
github.com/minio/mc v0.0.0-20230421183052-0da22db3af01
|
||||
github.com/minio/madmin-go/v2 v2.1.1
|
||||
github.com/minio/mc v0.0.0-20230509151326-6050568e66a6
|
||||
github.com/minio/minio-go/v7 v7.0.52
|
||||
github.com/minio/operator v0.0.0-20230228004026-ad024a9dffe5
|
||||
github.com/minio/pkg v1.6.5
|
||||
|
||||
8
go.sum
8
go.sum
@@ -655,10 +655,10 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT
|
||||
github.com/minio/kes v0.22.3 h1:aSPW9uCMVaLax5POxvoQJxCU4MNo/KzMXA7WfmC/lRw=
|
||||
github.com/minio/kes v0.22.3/go.mod h1:wnhmdwWX2rpurNPKn3yDFImg2wuc7j3e+IU5rVkR9UY=
|
||||
github.com/minio/madmin-go v1.6.6/go.mod h1:ATvkBOLiP3av4D++2v1UEHC/QzsGtgXD5kYvvRYzdKs=
|
||||
github.com/minio/madmin-go/v2 v2.0.20 h1:EO2IIQsnaVM3ki/ONcW0Ry4UpDn5aa+/S1kLkHuDBs8=
|
||||
github.com/minio/madmin-go/v2 v2.0.20/go.mod h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
|
||||
github.com/minio/mc v0.0.0-20230421183052-0da22db3af01 h1:8o0xnhhmVlFDi+BMYib5EL5cgBD1z5M2Wk8RrZF6RFg=
|
||||
github.com/minio/mc v0.0.0-20230421183052-0da22db3af01/go.mod h1:v9AeUV4eaMpKCuNz0tk/MSGxvNs3duYvWUIxzpacxtc=
|
||||
github.com/minio/madmin-go/v2 v2.1.1 h1:qUdJP31MD3ThPOmvfRby0J5ZJdAw5XK67LxTkUI9DWA=
|
||||
github.com/minio/madmin-go/v2 v2.1.1/go.mod h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
|
||||
github.com/minio/mc v0.0.0-20230509151326-6050568e66a6 h1:bRJ1PnUl58yZ4gUlHyCWexmv6jxBBfq1pmjrt1PERHw=
|
||||
github.com/minio/mc v0.0.0-20230509151326-6050568e66a6/go.mod h1:qs/xdw+kX2neHHthlUZ5pHc0RUKwxlzcaZfAkEKpmSI=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
github.com/minio/minio-go/v7 v7.0.41/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw=
|
||||
|
||||
@@ -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