Skip to content

Commit 8c78612

Browse files
committed
feat(config,cache/s3proxy): add s3 addressing style support
1 parent dc4aeac commit 8c78612

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

cache/s3proxy/s3proxy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func New(
4949
// S3CloudStorageConfig struct fields:
5050
Endpoint string,
5151
Bucket string,
52+
BucketLookupType minio.BucketLookupType,
5253
Prefix string,
5354
Credentials *credentials.Credentials,
5455
DisableSSL bool,
@@ -69,7 +70,8 @@ func New(
6970

7071
// Initialize minio client with credentials
7172
opts := &minio.Options{
72-
Creds: Credentials,
73+
Creds: Credentials,
74+
BucketLookup: BucketLookupType,
7375

7476
Region: Region,
7577
Secure: !DisableSSL,

config/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ go_library(
2020
"//cache/s3proxy:go_default_library",
2121
"@com_github_azure_azure_sdk_for_go_sdk_azcore//:go_default_library",
2222
"@com_github_azure_azure_sdk_for_go_sdk_azidentity//:go_default_library",
23+
"@com_github_minio_minio_go_v7//:go_default_library",
2324
"@com_github_minio_minio_go_v7//pkg/credentials:go_default_library",
2425
"@com_github_urfave_cli_v2//:go_default_library",
2526
"@in_gopkg_yaml_v3//:go_default_library",

config/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (c *Config) setProxy() error {
4949
c.ProxyBackend = s3proxy.New(
5050
c.S3CloudStorage.Endpoint,
5151
c.S3CloudStorage.Bucket,
52+
c.S3CloudStorage.BucketLookupType,
5253
c.S3CloudStorage.Prefix,
5354
creds,
5455
c.S3CloudStorage.DisableSSL,

config/s3.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/buchgr/bazel-remote/v2/cache/s3proxy"
88

9+
"github.com/minio/minio-go/v7"
910
"github.com/minio/minio-go/v7/pkg/credentials"
1011
)
1112

@@ -24,6 +25,8 @@ type S3CloudStorageConfig struct {
2425
KeyVersion *int `yaml:"key_version"`
2526
AWSProfile string `yaml:"aws_profile"`
2627
AWSSharedCredentialsFile string `yaml:"aws_shared_credentials_file"`
28+
29+
BucketLookupType minio.BucketLookupType `yaml:"bucket_lookup_type"`
2730
}
2831

2932
func (s3c S3CloudStorageConfig) GetCredentials() (*credentials.Credentials, error) {

0 commit comments

Comments
 (0)