Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Remove hardcoded us-east-1
Browse files Browse the repository at this point in the history
  • Loading branch information
tirsen committed Sep 29, 2020
1 parent 94f4723 commit c0be5fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ type S3BackendOptions struct {

// Apply apply s3 options on backup.S3.
func (options *S3BackendOptions) Apply(s3 *backup.S3) error {
if options.Region == "" {
options.Region = "us-east-1"
}
if options.Endpoint != "" {
u, err := url.Parse(options.Endpoint)
if err != nil {
Expand Down Expand Up @@ -176,7 +173,7 @@ func defineS3Flags(flags *pflag.FlagSet) {
// TODO: remove experimental tag if it's stable
flags.String(s3EndpointOption, "",
"(experimental) Set the S3 endpoint URL, please specify the http or https scheme explicitly")
flags.String(s3RegionOption, "", "(experimental) Set the S3 region, e.g. us-east-1")
flags.String(s3RegionOption, "", "(experimental) Set the S3 region, e.g. us-east-1, defaults to using the AWS_REGION env var")
flags.String(s3StorageClassOption, "", "(experimental) Set the S3 storage class, e.g. STANDARD")
flags.String(s3SseOption, "", "Set S3 server-side encryption, e.g. aws:kms")
flags.String(s3SseKmsKeyIDOption, "", "KMS CMK key id to use with S3 server-side encryption."+
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (r *testStorageSuite) TestApplyUpdate(c *C) {
Endpoint: "",
},
s3: &backup.S3{
Region: "us-east-1",
Region: "",
Bucket: "bucket",
Prefix: "prefix",
},
Expand All @@ -131,7 +131,7 @@ func (r *testStorageSuite) TestApplyUpdate(c *C) {
Endpoint: "https://s3.us-west-2",
},
s3: &backup.S3{
Region: "us-east-1",
Region: "",
Endpoint: "https://s3.us-west-2",
Bucket: "bucket",
Prefix: "prefix",
Expand All @@ -143,7 +143,7 @@ func (r *testStorageSuite) TestApplyUpdate(c *C) {
Endpoint: "http://s3.us-west-2",
},
s3: &backup.S3{
Region: "us-east-1",
Region: "",
Endpoint: "http://s3.us-west-2",
Bucket: "bucket",
Prefix: "prefix",
Expand Down

0 comments on commit c0be5fc

Please sign in to comment.