mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
Fixed Minio NewStorage to return the MakeBucket error instead of the (#1302)
Bucket exists error. See #1295
This commit is contained in:
committed by
Aaron Schlesinger
parent
7de77889ad
commit
33d01b1a7a
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user