Skip to content

Commit

Permalink
fix config from s3
Browse files Browse the repository at this point in the history
  • Loading branch information
mashiike committed Jun 14, 2022
1 parent a7b4e6a commit 9eff67f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ func fetchConfigFromS3(ctx context.Context, u *url.URL) ([]byte, error) {
}
downloader := manager.NewDownloader(s3.NewFromConfig(awsCfg))
var buf manager.WriteAtBuffer
downloader.Download(ctx, &buf, &s3.GetObjectInput{
logx.Printf(ctx, "[debug] try download Bucket=%s, Key=%s", u.Host, u.Path)
_, err = downloader.Download(ctx, &buf, &s3.GetObjectInput{
Bucket: aws.String(u.Host),
Key: aws.String(u.Path),
Key: aws.String(strings.TrimLeft(u.Path, "/")),
})
if err != nil {
return nil, fmt.Errorf("failed to fetch from S3, %s", err)
Expand Down

0 comments on commit 9eff67f

Please sign in to comment.