From 5a30dadbe313319d8687c84b99814c7a342fca7e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 23 Nov 2015 14:09:12 -0800 Subject: [PATCH] region: minio server and minio-go now honor 'us-east-1' as default region --- vendor/github.com/minio/minio-go/api.go | 24 +++++++------------ .../minio/minio-go/api_private_test.go | 2 +- vendor/vendor.json | 4 ++-- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/vendor/github.com/minio/minio-go/api.go b/vendor/github.com/minio/minio-go/api.go index 5ee2302f..79148ae9 100644 --- a/vendor/github.com/minio/minio-go/api.go +++ b/vendor/github.com/minio/minio-go/api.go @@ -104,8 +104,7 @@ func getRegion(host string) (region string) { return regions[host] } // Region cannot be empty according to Amazon S3 for AWS Signature Version 4. - // So we will in-turn address all the four quadrants of our galaxy. - return "milkyway" + return "us-east-1" } // getEndpoint returns a endpoint based on its region. @@ -642,18 +641,14 @@ func (a API) PutObject(bucket, object, contentType string, size int64, data io.R if err := invalidArgumentError(object); err != nil { return err } - // for un-authenticated requests do not initiated multipart operation. - // - // NOTE: this behavior is only kept valid for S3, since S3 doesn't - // allow unauthenticated multipart requests. - if a.config.Region != "milkyway" { - if a.config.AccessKeyID == "" || a.config.SecretAccessKey == "" { - _, err := a.putObjectUnAuthenticated(bucket, object, contentType, size, data) - if err != nil { - return err - } - return nil + // for un-authenticated requests do not initiate multipart operation. + // NOTE: S3 doesn't allow unauthenticated multipart requests. + if a.config.AccessKeyID == "" || a.config.SecretAccessKey == "" { + _, err := a.putObjectUnAuthenticated(bucket, object, contentType, size, data) + if err != nil { + return err } + return nil } // Special handling just for Google Cloud Storage. // TODO - we should remove this in future when we fully implement Resumable object upload. @@ -756,9 +751,6 @@ func (a API) MakeBucket(bucket string, acl BucketACL) error { return invalidArgumentError("") } location := a.config.Region - if location == "milkyway" { - location = "" - } if location == "us-east-1" { location = "" } diff --git a/vendor/github.com/minio/minio-go/api_private_test.go b/vendor/github.com/minio/minio-go/api_private_test.go index 23d1832a..f9cd9f43 100644 --- a/vendor/github.com/minio/minio-go/api_private_test.go +++ b/vendor/github.com/minio/minio-go/api_private_test.go @@ -68,7 +68,7 @@ func TestGetRegion(t *testing.T) { t.Fatalf("Error") } region = getRegion("localhost:9000") - if region != "milkyway" { + if region != "us-east-1" { t.Fatalf("Error") } } diff --git a/vendor/vendor.json b/vendor/vendor.json index d0cbefe0..aa70bd6e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -29,8 +29,8 @@ }, { "path": "github.com/minio/minio-go", - "revision": "577f4282e75b8552bdf754afd8003165ee3cc14d", - "revisionTime": "2015-11-20T16:01:24-08:00" + "revision": "bf8996055bebd547d940b8579d2ec05f2d37ede8", + "revisionTime": "2015-11-23T14:07:27-08:00" }, { "path": "github.com/minio/minio-xl/pkg/atomic",