Skip to content

Commit

Permalink
no 'replicate status' without replication config (#15233)
Browse files Browse the repository at this point in the history
'replicate status' shouldn't be displaying historic
values unless replication config is present on the
relevant bucket.
  • Loading branch information
harshavardhana committed Jul 6, 2022
1 parent 2518af5 commit 3af6073
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/bucket-replication-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ func (api objectAPIHandlers) GetBucketReplicationMetricsHandler(w http.ResponseW
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}

if _, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket); err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}

var usageInfo BucketUsageInfo
dataUsageInfo, err := loadDataUsageFromBackend(ctx, objectAPI)
if err == nil && !dataUsageInfo.LastUpdate.IsZero() {
Expand Down

0 comments on commit 3af6073

Please sign in to comment.