mirror of
https://github.com/minio/minio.git
synced 2025-04-19 02:05:24 -04:00
fix: error checking in DeleteBucket (#16929)
This commit is contained in:
parent
7a6c4e438e
commit
dc8fdcb9c9
@ -1658,14 +1658,14 @@ func (z *erasureServerPools) DeleteBucket(ctx context.Context, bucket string, op
|
|||||||
}
|
}
|
||||||
|
|
||||||
err := z.s3Peer.DeleteBucket(ctx, bucket, opts)
|
err := z.s3Peer.DeleteBucket(ctx, bucket, opts)
|
||||||
if err == nil || errors.Is(err, errVolumeNotFound) {
|
if err == nil || isErrBucketNotFound(err) {
|
||||||
// If site replication is configured, hold on to deleted bucket state until sites sync
|
// If site replication is configured, hold on to deleted bucket state until sites sync
|
||||||
if opts.SRDeleteOp == MarkDelete {
|
if opts.SRDeleteOp == MarkDelete {
|
||||||
z.s3Peer.MakeBucket(context.Background(), pathJoin(minioMetaBucket, bucketMetaPrefix, deletedBucketsPrefix, bucket), MakeBucketOptions{})
|
z.s3Peer.MakeBucket(context.Background(), pathJoin(minioMetaBucket, bucketMetaPrefix, deletedBucketsPrefix, bucket), MakeBucketOptions{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil && !errors.Is(err, errVolumeNotFound) {
|
if err != nil && !isErrBucketNotFound(err) {
|
||||||
if !opts.NoRecreate {
|
if !opts.NoRecreate {
|
||||||
z.s3Peer.MakeBucket(ctx, bucket, MakeBucketOptions{})
|
z.s3Peer.MakeBucket(ctx, bucket, MakeBucketOptions{})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user