Skip to content

Commit

Permalink
feat: add s3ForcePathStyle option for s3 publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
0xlau committed Nov 9, 2024
1 parent d971224 commit f386eac
Showing 1 changed file with 15 additions and 8 deletions.
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)
}

Expand Down

0 comments on commit f386eac

Please sign in to comment.