Merge pull request #9931 from GennadySpb/yndx-import-fix-url

yandex-import: Fix S3 URL construct process
This commit is contained in:
Megan Marsh 2020-09-11 07:48:11 -07:00 committed by GitHub
commit bcd3c33e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,12 @@ func uploadToBucket(s3conn *s3.S3, ui packer.Ui, artifact packer.Artifact, bucke
// Compute service allow only `https://storage.yandexcloud.net/...` URLs for Image create process
req.Config.S3ForcePathStyle = aws.Bool(true)
err = req.Build()
if err != nil {
ui.Say(fmt.Sprintf("Failed to build S3 request: %v", err))
return nil, err
}
return &objectSource{
url: req.HTTPRequest.URL.String(),
}, nil