Skip to content

Commit

Permalink
Merge remote-tracking branch 'pingcap/master' into fix-flaky-test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysan committed Feb 23, 2023
2 parents 0c79cc8 + 7cac20e commit 0ba73bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions br/pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func createOssRAMCred() (*credentials.Credentials, error) {
}

// NewS3Storage initialize a new s3 storage for metadata.
func NewS3Storage(backend *backuppb.S3, opts *ExternalStorageOptions) (obj *S3Storage, errRet error) {
func NewS3Storage(ctx context.Context, backend *backuppb.S3, opts *ExternalStorageOptions) (obj *S3Storage, errRet error) {
qs := *backend
awsConfig := aws.NewConfig().
WithS3ForcePathStyle(qs.ForcePathStyle).
Expand Down Expand Up @@ -371,7 +371,7 @@ func NewS3Storage(backend *backuppb.S3, opts *ExternalStorageOptions) (obj *S3St
req.Config.S3ForcePathStyle = ses.Config.S3ForcePathStyle
}
}
region, err := s3manager.GetBucketRegionWithClient(context.Background(), c, qs.Bucket, setCredOpt)
region, err := s3manager.GetBucketRegionWithClient(ctx, c, qs.Bucket, setCredOpt)
if err != nil {
return nil, errors.Annotatef(err, "failed to get region of bucket %s", qs.Bucket)
}
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func New(ctx context.Context, backend *backuppb.StorageBackend, opts *ExternalSt
if backend.S3 == nil {
return nil, errors.Annotate(berrors.ErrStorageInvalidConfig, "s3 config not found")
}
return NewS3Storage(backend.S3, opts)
return NewS3Storage(ctx, backend.S3, opts)
case *backuppb.StorageBackend_Noop:
return newNoopStorage(), nil
case *backuppb.StorageBackend_Gcs:
Expand Down

0 comments on commit 0ba73bf

Please sign in to comment.