Skip to content

Commit

Permalink
Allow bucket creation in different regions, closes minio#4287 and min…
Browse files Browse the repository at this point in the history
…io#4241

* I needed to remove the region check from PutBucketHandler
  • Loading branch information
nl5887 authored and harshavardhana committed Jun 16, 2017
1 parent 8085ba4 commit d86973d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions cmd/gateway-gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ func (l *gcsGateway) MakeBucket(bucket string) error {
func (l *gcsGateway) MakeBucketWithLocation(bucket, location string) error {
bkt := l.client.Bucket(bucket)

// we'll default to the us multi-region in case of us-east-1
if location == "us-east-1" {
location = "us"
}

if err := bkt.Create(l.ctx, l.projectID, &storage.BucketAttrs{
Location: location,
}); err != nil {
Expand Down
9 changes: 0 additions & 9 deletions cmd/gateway-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,6 @@ func (api gatewayAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Re
return
}

// validating region here, because isValidLocationConstraint
// reads body which has been read already. So only validating
// region here.
serverRegion := serverConfig.GetRegion()
if serverRegion != "" && serverRegion != location {
writeErrorResponse(w, ErrInvalidRegion, r.URL)
return
}

bucketLock := globalNSMutex.NewNSLock(bucket, "")
bucketLock.Lock()
defer bucketLock.Unlock()
Expand Down

0 comments on commit d86973d

Please sign in to comment.