Fixed Minio NewStorage to return the MakeBucket error instead of the (#1302)

Bucket exists error.  See #1295
This commit is contained in:
James Naftel
2019-07-16 18:23:04 -04:00
committed by Aaron Schlesinger
parent 7de77889ad
commit 33d01b1a7a
2 changed files with 63 additions and 2 deletions
+3 -2
View File
@@ -39,8 +39,9 @@ func NewStorage(conf *config.MinioConfig, timeout time.Duration) (storage.Backen
err = minioClient.MakeBucket(bucketName, region)
if err != nil {
// Check to see if we already own this bucket
exists, err := minioClient.BucketExists(bucketName)
if err == nil && !exists {
exists, _ := minioClient.BucketExists(bucketName)
if !exists {
// MakeBucket Error takes priority
return nil, errors.E(op, err)
}
}