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

br: fix S3 backup endpoint suffix #30530

Merged
merged 18 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6718f40
br: fix S3 backup endpoint suffix
tongtongyin Dec 8, 2021
a476f29
Merge branch 'master' into fix-s3-backup-endpoint-suffix
tongtongyin Dec 8, 2021
4d80a86
fix-s3-backup-endpoint-suffix
tongtongyin Dec 18, 2021
42a8155
Merge branch 'fix-s3-backup-endpoint-suffix' of github.com:tongtongyi…
tongtongyin Dec 18, 2021
ff085fd
Merge branch 'master' into fix-s3-backup-endpoint-suffix
tongtongyin Dec 18, 2021
7d66ff5
fix s3 backup endpoint suffix
tongtongyin Dec 20, 2021
7ae102f
Merge branch 'fix-s3-backup-endpoint-suffix' of github.com:tongtongyi…
tongtongyin Dec 20, 2021
060c1d7
Merge branch 'master' into fix-s3-backup-endpoint-suffix
tongtongyin Dec 20, 2021
c68a9eb
fix s3 backup endpoint suffix
tongtongyin Dec 20, 2021
776482e
Merge branch 'fix-s3-backup-endpoint-suffix' of github.com:tongtongyi…
tongtongyin Dec 20, 2021
704be33
Merge branch 'master' into fix-s3-backup-endpoint-suffix
tongtongyin Dec 20, 2021
5a29399
Merge branch 'master' into fix-s3-backup-endpoint-suffix
glorv Dec 20, 2021
3b774d6
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
046b89d
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
7c56a39
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
6e241dc
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
590699e
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
917bdc7
Merge branch 'master' into fix-s3-backup-endpoint-suffix
ti-chi-bot Dec 20, 2021
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
2 changes: 1 addition & 1 deletion br/pkg/storage/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *testStorageSuite) TestCreateStorage(c *C) {
c.Assert(s3, NotNil)
c.Assert(s3.Bucket, Equals, "bucket2")
c.Assert(s3.Prefix, Equals, "prefix")
c.Assert(s3.Endpoint, Equals, "https://s3.example.com/")
c.Assert(s3.Endpoint, Equals, "https://s3.example.com")
c.Assert(s3.ForcePathStyle, IsFalse)

// nolint:lll
Expand Down
3 changes: 2 additions & 1 deletion br/pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (options *S3BackendOptions) Apply(s3 *backuppb.S3) error {
return errors.Annotate(berrors.ErrStorageInvalidConfig, "secret_access_key not found")
}

s3.Endpoint = options.Endpoint
s3.Endpoint = strings.TrimSuffix(options.Endpoint, "/")
s3.Region = options.Region
// StorageClass, SSE and ACL are acceptable to be empty
s3.StorageClass = options.StorageClass
Expand Down Expand Up @@ -189,6 +189,7 @@ func (options *S3BackendOptions) parseFromFlags(flags *pflag.FlagSet) error {
if err != nil {
return errors.Trace(err)
}
options.Endpoint = strings.TrimSuffix(options.Endpoint, "/")
options.Region, err = flags.GetString(s3RegionOption)
if err != nil {
return errors.Trace(err)
Expand Down