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

feat: add s3ForcePathStyle option for s3 publisher #146

Merged
merged 3 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/healthy-flies-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-bin": minor
---

feat: add s3ForcePathStyle option for s3 publisher
23 changes: 15 additions & 8 deletions pkg/publisher/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
type ObjectOptions struct {
file *string

endpoint *string
region *string
bucket *string
key *string
forcePathStyle *bool
endpoint *string
region *string
bucket *string
key *string

acl *string
storageClass *string
Expand All @@ -40,10 +41,11 @@ func ConfigurePublishToS3Command(app *kingpin.Application) {
options := ObjectOptions{
file: command.Flag("file", "").Required().String(),

region: command.Flag("region", "").String(),
bucket: command.Flag("bucket", "").Required().String(),
key: command.Flag("key", "").Required().String(),
endpoint: command.Flag("endpoint", "").String(),
forcePathStyle: command.Flag("forcePathStyle", "").Default("true").Bool(),
region: command.Flag("region", "").String(),
bucket: command.Flag("bucket", "").Required().String(),
key: command.Flag("key", "").Required().String(),
endpoint: command.Flag("endpoint", "").String(),

acl: command.Flag("acl", "").String(),
storageClass: command.Flag("storageClass", "").String(),
Expand Down Expand Up @@ -112,6 +114,11 @@ func upload(options *ObjectOptions) error {
}
if *options.endpoint != "" {
awsConfig.Endpoint = options.endpoint
}

if options.forcePathStyle != nil {
awsConfig.S3ForcePathStyle = aws.Bool(options.forcePathStyle)
} else {
awsConfig.S3ForcePathStyle = aws.Bool(true)
}
0xlau marked this conversation as resolved.
Show resolved Hide resolved

Expand Down