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

master
Shireesh Anjal 4 years ago committed by GitHub
parent 13d015cf93
commit 3afa499885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/admin-handlers.go
  2. 11
      pkg/madmin/info-commands.go

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

@ -195,17 +195,20 @@ type Services struct {
// Buckets contains the number of buckets // Buckets contains the number of buckets
type Buckets struct { type Buckets struct {
Count uint64 `json:"count,omitempty"` Count uint64 `json:"count"`
Error string `json:"error,omitempty"`
} }
// Objects contains the number of objects // Objects contains the number of objects
type Objects struct { 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 { type Usage struct {
Size uint64 `json:"size,omitempty"` Size uint64 `json:"size"`
Error string `json:"error,omitempty"`
} }
// KMS contains KMS status information // KMS contains KMS status information

Loading…
Cancel
Save