fix: empty buckets/objects nodes in new setup (#11493)

This commit is contained in:
Shireesh Anjal 2021-02-09 23:22:38 +05:30 committed by GitHub
parent 13d015cf93
commit 3afa499885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -1585,6 +1585,10 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque
buckets = madmin.Buckets{Count: dataUsageInfo.BucketsCount}
objects = madmin.Objects{Count: dataUsageInfo.ObjectsTotalCount}
usage = madmin.Usage{Size: dataUsageInfo.ObjectsTotalSize}
} else {
buckets = madmin.Buckets{Error: err.Error()}
objects = madmin.Objects{Error: err.Error()}
usage = madmin.Usage{Error: err.Error()}
}
// Fetching the backend information

View File

@ -195,17 +195,20 @@ type Services struct {
// Buckets contains the number of buckets
type Buckets struct {
Count uint64 `json:"count,omitempty"`
Count uint64 `json:"count"`
Error string `json:"error,omitempty"`
}
// Objects contains the number of objects
type Objects struct {
Count uint64 `json:"count,omitempty"`
Count uint64 `json:"count"`
Error string `json:"error,omitempty"`
}
// Usage contains the tottal size used
// Usage contains the total size used
type Usage struct {
Size uint64 `json:"size,omitempty"`
Size uint64 `json:"size"`
Error string `json:"error,omitempty"`
}
// KMS contains KMS status information