@@ -73,34 +73,11 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) {
73
73
// we are trimming uint64 to int64 this will report an incorrect measurement for numbers greater than
74
74
// 9,223,372,036,854,775,807
75
75
76
- var backendType string
77
- var rrSCParity float64
78
- var standardSCParity float64
79
- var onlineDrives float64
80
- var offlineDrives float64
81
-
82
- if v , success := serverInfo .Backend .(map [string ]interface {}); success {
83
- bt , ok := v ["backendType" ]
84
- if ok {
85
- backendType = bt .(string )
86
- }
87
- rp , ok := v ["rrSCParity" ]
88
- if ok {
89
- rrSCParity = rp .(float64 )
90
- }
91
- sp , ok := v ["standardSCParity" ]
92
- if ok {
93
- standardSCParity = sp .(float64 )
94
- }
95
- onDrives , ok := v ["onlineDisks" ]
96
- if ok {
97
- onlineDrives = onDrives .(float64 )
98
- }
99
- offDrives , ok := v ["offlineDisks" ]
100
- if ok {
101
- offlineDrives = offDrives .(float64 )
102
- }
103
- }
76
+ backendType := serverInfo .Backend .Type
77
+ rrSCParity := serverInfo .Backend .RRSCParity
78
+ standardSCParity := serverInfo .Backend .StandardSCParity
79
+ onlineDrives := serverInfo .Backend .OnlineDisks
80
+ offlineDrives := serverInfo .Backend .OfflineDisks
104
81
105
82
var usedSpace int64
106
83
// serverArray contains the serverProperties which describe the servers in the network
@@ -139,7 +116,7 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) {
139
116
}
140
117
141
118
backendData := & models.BackendProperties {
142
- BackendType : backendType ,
119
+ BackendType : string ( backendType ) ,
143
120
RrSCParity : int64 (rrSCParity ),
144
121
StandardSCParity : int64 (standardSCParity ),
145
122
OnlineDrives : int64 (onlineDrives ),
0 commit comments