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

APPS-1298 Make s3-endpoint-override field optional #231

Merged
merged 2 commits into from
Sep 15, 2024
Merged
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
8 changes: 4 additions & 4 deletions pkg/service/backup_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func getWriter(ctx context.Context, path *string, storage *model.Storage,
ctx,
*storage.S3Profile,
*storage.S3Region,
*storage.S3EndpointOverride,
storage.S3EndpointOverride,
storage.MaxConnsPerHost,
)
if err != nil {
Expand All @@ -164,7 +164,7 @@ func getWriter(ctx context.Context, path *string, storage *model.Storage,
return nil, fmt.Errorf("unknown storage type %v", storage.Type)
}

func getS3Client(ctx context.Context, profile, region, endpoint string, maxConnsPerHost int) (*s3.Client, error) {
func getS3Client(ctx context.Context, profile, region string, endpoint *string, maxConnsPerHost int) (*s3.Client, error) {
cfg, err := config.LoadDefaultConfig(ctx,
config.WithSharedConfigProfile(profile),
config.WithRegion(region),
Expand All @@ -174,8 +174,8 @@ func getS3Client(ctx context.Context, profile, region, endpoint string, maxConns
}

client := s3.NewFromConfig(cfg, func(o *s3.Options) {
if endpoint != "" {
o.BaseEndpoint = &endpoint
if endpoint != nil {
o.BaseEndpoint = endpoint
}

o.UsePathStyle = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/restore_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func getReader(ctx context.Context, path *string, storage *model.Storage,
ctx,
*storage.S3Profile,
*storage.S3Region,
*storage.S3EndpointOverride,
storage.S3EndpointOverride,
storage.MaxConnsPerHost,
)
if err != nil {
Expand Down
Loading