GCP: Report the right error when image import fails

Fix a bug in the worker job implementation and GCP CLI upload tool,
which causes the code to report wrong error instance in case the image
import failed for some reason.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-03-12 17:53:57 +01:00 committed by Tomas Hozza
parent a6bc07fac0
commit fb089cf00d
2 changed files with 2 additions and 2 deletions

View file

@ -95,7 +95,7 @@ func main() {
// check error from ComputeImageImport()
if importErr != nil {
log.Fatalf("[GCP] Importing image failed: %v", err)
log.Fatalf("[GCP] Importing image failed: %v", importErr)
}
log.Printf("[GCP] 💿 Image URL: %s", g.ComputeImageURL(imageName))
}

View file

@ -298,7 +298,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
// check error from ComputeImageImport()
if importErr != nil {
r = append(r, err)
r = append(r, importErr)
continue
}
log.Printf("[GCP] 💿 Image URL: %s", g.ComputeImageURL(t.ImageName))