Fix S3 URL construct process

This commit is contained in:
Gennady Lipenkov 2020-09-11 16:49:30 +03:00
parent 2837d56885
commit e078bd6bf2
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