Skip to content

Commit

Permalink
[PBM-1133] add storage.s3.forcePathStyle (boolean) (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
defbin committed Jul 5, 2023
1 parent bdfba70 commit 888de63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pbm/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Conf struct {
Provider S3Provider `bson:"provider,omitempty" json:"provider,omitempty" yaml:"provider,omitempty"`
Region string `bson:"region" json:"region" yaml:"region"`
EndpointURL string `bson:"endpointUrl,omitempty" json:"endpointUrl" yaml:"endpointUrl,omitempty"`
ForcePathStyle *bool `bson:"forcePathStyle,omitempty" json:"forcePathStyle,omitempty" yaml:"forcePathStyle,omitempty"`
Bucket string `bson:"bucket" json:"bucket" yaml:"bucket"`
Prefix string `bson:"prefix,omitempty" json:"prefix,omitempty" yaml:"prefix,omitempty"`
Credentials Credentials `bson:"credentials" json:"-" yaml:"credentials"`
Expand Down Expand Up @@ -131,6 +132,9 @@ func (c *Conf) Cast() error {
if c.Region == "" {
c.Region = defaultS3Region
}
if c.ForcePathStyle == nil {
c.ForcePathStyle = aws.Bool(true)
}
if c.Provider == S3ProviderUndef {
c.Provider = S3ProviderAWS
if c.EndpointURL != "" {
Expand Down Expand Up @@ -566,7 +570,7 @@ func (s *S3) session() (*session.Session, error) {
Region: aws.String(s.opts.Region),
Endpoint: aws.String(s.opts.EndpointURL),
Credentials: credentials.NewChainCredentials(providers),
S3ForcePathStyle: aws.Bool(true),
S3ForcePathStyle: s.opts.ForcePathStyle,
HTTPClient: httpClient,
LogLevel: aws.LogLevel(SDKLogLevel(s.opts.DebugLogLevels, nil)),
Logger: awsLogger(s.log),
Expand Down

0 comments on commit 888de63

Please sign in to comment.