mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
tier: Add force param to force tiering removal (#20355)
Currently, it is not possible to remove a tier if it is not accessible or contains some data, add a force flag to make the removal successful in that case.
This commit is contained in:
@@ -198,12 +198,14 @@ func (api adminAPIHandlers) RemoveTierHandler(w http.ResponseWriter, r *http.Req
|
||||
|
||||
vars := mux.Vars(r)
|
||||
tier := vars["tier"]
|
||||
force := r.Form.Get("force") == "true"
|
||||
|
||||
if err := globalTierConfigMgr.Reload(ctx, objAPI); err != nil {
|
||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||
return
|
||||
}
|
||||
|
||||
if err := globalTierConfigMgr.Remove(ctx, tier); err != nil {
|
||||
if err := globalTierConfigMgr.Remove(ctx, tier, force); err != nil {
|
||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user