rb: avoid throwing error for force delete of prefix (#4436)

This commit is contained in:
Poorna
2023-01-06 12:09:09 -08:00
committed by GitHub
parent cca1fd7c82
commit 55a9d204db
+9
View File
@@ -199,6 +199,15 @@ func deleteBucket(ctx context.Context, url string, isForce bool) *probe.Error {
return result.Err.Trace(url)
}
}
// Return early if prefix delete
switch c := clnt.(type) {
case *S3Client:
_, object := c.url2BucketAndObject()
if object != "" && isForce {
return nil
}
default:
}
// Remove a bucket without force flag first because force
// won't work if a bucket has some locking rules, that's