rebalance status must return appropriate error initially (#16022)

This commit is contained in:
Harshavardhana 2022-11-08 07:56:45 -08:00 committed by GitHub
parent 808739867c
commit 72afc2727a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,7 +314,7 @@ func (a adminAPIHandlers) RebalanceStatus(w http.ResponseWriter, r *http.Request
rs, err := rebalanceStatus(ctx, pools) rs, err := rebalanceStatus(ctx, pools)
if err != nil { if err != nil {
if errors.Is(err, errRebalanceNotStarted) { if errors.Is(err, errRebalanceNotStarted) || errors.Is(err, errConfigNotFound) {
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminRebalanceNotStarted), r.URL) writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminRebalanceNotStarted), r.URL)
return return
} }