Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an UsePathStyle field to the S3 config structure #31

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/configFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type S3Configuration struct {
Endpoint string `yaml:"endpoint" json:"endpoint"`
Timeout time.Duration `yaml:"timeout" json:"timeout"`
SkipSSLVerify bool `yaml:"skipSSLverify" json:"skipSSLverify"`
UsePathStyle bool `yaml:"usePathStyle" json:"usePathStyle"`
}

// GrafanaConfiguration contains all information necessary to add annotations
Expand Down
1 change: 1 addition & 0 deletions common/configFile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ tests:
SecretKey: "secretSecret",
Region: "us-east-1",
SkipSSLVerify: true,
UsePathStyle: false,
},
},
Tests: []*TestCaseConfiguration{
Expand Down
6 changes: 3 additions & 3 deletions examples/example_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"s3_config": [
{
"access_key": "abc", "secret_key": "as", "region": "eu-central-1", "endpoint": "https://my.rgw.endpoint:8080",
"skipSSLverify": false
"skipSSLverify": false, "usePathStyle": false
},
{
"access_key": "def", "secret_key": "as", "region": "eu-central-2", "endpoint": "https://my.rgw.endpoint:8080",
"skipSSLverify": false
"skipSSLverify": false, "usePathStyle": false
},
{
"access_key": "ghi", "secret_key": "as", "region": "eu-central-3", "endpoint": "https://my.rgw.endpoint:8080",
"skipSSLverify": false
"skipSSLverify": false, "usePathStyle": false
}
],
"grafana_config": { "endpoint": "http://grafana", "username": "admin", "password": "grafana" },
Expand Down
3 changes: 3 additions & 0 deletions examples/example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ s3_config:
region: eu-central-1
endpoint: https://my.rgw.endpoint:8080
skipSSLverify: false
usePathStyle: false
- access_key: def
secret_key: as
region: eu-central-2
endpoint: https://my.rgw.endpoint:8080
skipSSLverify: false
usePathStyle: false
- access_key: ghi
secret_key: as
region: eu-central-3
endpoint: https://my.rgw.endpoint:8080
skipSSLverify: false
usePathStyle: false

# For generating annotations when we start/stop testcases
# https://grafana.com/docs/http_api/annotations/#create-annotation
Expand Down
1 change: 1 addition & 0 deletions k8s/gosbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data:
region: eu-central-1
endpoint: https://172.30.196.58:443
skipSSLverify: true
usePathStyle: false

# For generating annotations when we start/stop testcases
# https://grafana.com/docs/http_api/annotations/#create-annotation
Expand Down
1 change: 1 addition & 0 deletions k8s/gosbench_template.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data:
region: eu-central-1
endpoint: https://172.30.196.58:443
skipSSLverify: true
usePathStyle: false

# For generating annotations when we start/stop testcases
# https://grafana.com/docs/http_api/annotations/#create-annotation
Expand Down
2 changes: 2 additions & 0 deletions worker/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ func InitS3(config common.S3Configuration) {
// specific configuration.
svc = s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(config.Endpoint)
o.UsePathStyle = config.UsePathStyle
})
// Use this service to do things that are hidden from the performance monitoring
housekeepingSvc = s3.NewFromConfig(hkCfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(config.Endpoint)
o.UsePathStyle = config.UsePathStyle
})

log.Debug("S3 Init done")
Expand Down