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

Commit

Permalink
lightning: replace storage.Create by storage.New (#899)
Browse files Browse the repository at this point in the history
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
  • Loading branch information
kennytm and ti-srebot authored Mar 24, 2021
1 parent 8f80b8e commit fea552d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/lightning/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ func (l *Lightning) run(taskCtx context.Context, taskCfg *config.Config, g glue.
if err != nil {
return errors.Annotate(err, "parse backend failed")
}
s, err := storage.Create(ctx, u, true)
s, err := storage.New(ctx, u, &storage.ExternalStorageOptions{
// we skip check path in favor of delaying the error to when we actually access the file.
// on S3, performing "check path" requires the additional "s3:ListBucket" permission.
SkipCheckPath: true,
})
if err != nil {
return errors.Annotate(err, "create storage failed")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lightning/mydump/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func NewMyDumpLoader(ctx context.Context, cfg *config.Config) (*MDLoader, error)
if err != nil {
return nil, err
}
s, err := storage.Create(ctx, u, true)
s, err := storage.New(ctx, u, &storage.ExternalStorageOptions{SkipCheckPath: true})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit fea552d

Please sign in to comment.