Skip to content

Commit

Permalink
[K10-1654] ObjectStore shouldn't get region for s3 compatible stores …
Browse files Browse the repository at this point in the history
…with endpoints (#4271)

* ObjectStore ignore region if endpoint

* check getRegion error

* fix tests

* Address review comments

* Remove test for generic s3 with no region
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed Oct 25, 2018
1 parent 2090564 commit 08fed5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/objectstore/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,14 @@ type s3Provider struct {
}

func (p *s3Provider) GetBucket(ctx context.Context, bucketName string) (Bucket, error) {
region, _ := p.getRegionForBucket(ctx, bucketName)
hostEndPoint := p.hostEndPoint
if hostEndPoint != "" {
var region string
if hostEndPoint == "" {
var err error
region, err = p.getRegionForBucket(ctx, bucketName)
if err != nil {
return nil, errors.Wrapf(err, "could not get region for bucket %s", bucketName)
}
hostEndPoint = awsS3Endpoint(region)
}
location, err := getStowLocation(ctx, p.config, p.secret, region)
Expand Down

0 comments on commit 08fed5f

Please sign in to comment.