diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index 200dfb68b..3d047ceda 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -1217,6 +1217,7 @@ func (a adminAPIHandlers) ObjectSpeedTestHandler(w http.ResponseWriter, r *http. storageClass := strings.TrimSpace(r.Form.Get(peerRESTStorageClass)) customBucket := strings.TrimSpace(r.Form.Get(peerRESTBucket)) autotune := r.Form.Get("autotune") == "true" + noClear := r.Form.Get("noclear") == "true" size, err := strconv.Atoi(sizeStr) if err != nil { @@ -1258,14 +1259,16 @@ func (a adminAPIHandlers) ObjectSpeedTestHandler(w http.ResponseWriter, r *http. return } - if !bucketExists { + if !noClear && !bucketExists { defer deleteObjectPerfBucket(objectAPI) } } - defer objectAPI.DeleteObject(ctx, customBucket, speedTest+SlashSeparator, ObjectOptions{ - DeletePrefix: true, - }) + if !noClear { + defer objectAPI.DeleteObject(ctx, customBucket, speedTest+SlashSeparator, ObjectOptions{ + DeletePrefix: true, + }) + } // Freeze all incoming S3 API calls before running speedtest. globalNotificationSys.ServiceFreeze(ctx, true)