Skip to content

Commit 10ebe5b

Browse files
authored
feat(datastore): datastore S3 use path style configuration (#322)
1 parent a4d6dbc commit 10ebe5b

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

deploy/charts/burrito/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ config:
7474
s3:
7575
# -- S3 bucket name
7676
bucket: ""
77+
# -- S3 option for bucket name in path instead of as subdomain
78+
usePathStyle: false
7779
# -- Datastore exposed port
7880
addr: ":8080"
7981
# -- Datastore hostname, used by controller, server and runner to reach the datastore

docs/operator-manual/datastore.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ config:
1212
mock: <false|true> # default: false
1313
s3:
1414
bucket: <bucket-name>
15+
usePathStyle: <false|true> # default: false
1516
gcs:
1617
bucket: <bucket-name>
1718
azure:

internal/burrito/config/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ type GCSConfig struct {
4040
}
4141

4242
type S3Config struct {
43-
Bucket string `mapstructure:"bucket"`
43+
Bucket string `mapstructure:"bucket"`
44+
UsePathStyle bool `mapstructure:"usePathStyle"`
4445
}
4546

4647
type AzureConfig struct {

internal/datastore/storage/s3/s3.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ func New(config config.S3Config) *S3 {
2424
if err != nil {
2525
panic(err)
2626
}
27-
client := storage.NewFromConfig(sdkConfig)
27+
client := storage.NewFromConfig(sdkConfig, func(o *storage.Options) {
28+
o.UsePathStyle = config.UsePathStyle
29+
})
2830
return &S3{
2931
Config: config,
3032
Client: client,

0 commit comments

Comments
 (0)