mirror of
https://github.com/minio/minio.git
synced 2025-02-04 10:26:01 -05:00
Fix delete bucket policies properly (#5540)
There was bug in previous PR where deleteBucketMetadata() was never called, fix it correctly.
This commit is contained in:
parent
d12bdd50ee
commit
03923947c4
@ -345,10 +345,12 @@ func (s *xlSets) MakeBucketWithLocation(bucket, location string) error {
|
|||||||
errs := g.Wait()
|
errs := g.Wait()
|
||||||
// Upon even a single write quorum error we undo all previously created buckets.
|
// Upon even a single write quorum error we undo all previously created buckets.
|
||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
if _, ok := err.(InsufficientWriteQuorum); ok {
|
if err != nil {
|
||||||
undoMakeBucketSets(bucket, s.sets, errs)
|
if _, ok := err.(InsufficientWriteQuorum); ok {
|
||||||
|
undoMakeBucketSets(bucket, s.sets, errs)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
@ -481,10 +483,12 @@ func (s *xlSets) DeleteBucket(bucket string) error {
|
|||||||
// For any write quorum failure, we undo all the delete buckets operation
|
// For any write quorum failure, we undo all the delete buckets operation
|
||||||
// by creating all the buckets again.
|
// by creating all the buckets again.
|
||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
if _, ok := err.(InsufficientWriteQuorum); ok {
|
if err != nil {
|
||||||
undoDeleteBucketSets(bucket, s.sets, errs)
|
if _, ok := err.(InsufficientWriteQuorum); ok {
|
||||||
|
undoDeleteBucketSets(bucket, s.sets, errs)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete all bucket metadata.
|
// Delete all bucket metadata.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user