Skip to content

Commit

Permalink
Merge pull request #418 from dmage/force-path-style
Browse files Browse the repository at this point in the history
Bug 1784208: force path style for custom endpoints
  • Loading branch information
openshift-merge-robot committed Dec 19, 2019
2 parents c18b1d5 + a7058b7 commit 787250a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,22 @@ func (d *driver) getS3Service() (*s3.S3, error) {

// A custom HTTPClient is used here since the default HTTPClients ProxyFromEnvironment
// uses a cache which won't let us update the proxy env vars
sess, err := session.NewSession(&aws.Config{
awsConfig := &aws.Config{
Credentials: credentials.NewStaticCredentials(cfg.AccessKey, cfg.SecretKey, ""),
Region: &d.Config.Region,
Endpoint: &d.Config.RegionEndpoint,
HTTPClient: &http.Client{
Transport: &http.Transport{
Proxy: func(req *http.Request) (*url.URL, error) {
return httpproxy.FromEnvironment().ProxyFunc()(req.URL)
},
},
},
})
}
if d.Config.RegionEndpoint != "" {
awsConfig.WithS3ForcePathStyle(true)
awsConfig.WithEndpoint(d.Config.RegionEndpoint)
}
sess, err := session.NewSession(awsConfig)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 787250a

Please sign in to comment.