Skip to content

Commit

Permalink
fix: propagate failed img pull error to response line (#1302)
Browse files Browse the repository at this point in the history
## Description:
Prior to this change, errors causing failed image pulls were not being
shown to the user.

In failed image pulls, user would see is `Failed fetching the required
image '%v', make sure that the image exists and is public"` - even if
that image was public and existed.

This PR propagates the image pull error all the way to the user to help
them better debug the failed image pull.

## Is this change user facing?
YES
  • Loading branch information
tedim52 committed Sep 14, 2023
1 parent 0e372f3 commit 9a4a928
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -63,7 +63,8 @@ func fetchImageFromBackend(ctx context.Context, wg *sync.WaitGroup, imageCurrent
err := (*backend).FetchImage(ctx, image)
if err != nil {
logrus.Warnf("Container image '%s' download failed. Error was: '%s'", image, err.Error())
pullErrors <- startosis_errors.NewValidationError("Failed fetching the required image '%v', make sure that the image exists and is public", image)
pullErrors <- startosis_errors.WrapWithValidationError(err, "Failed fetching the required image '%v'.", image)
return
}
logrus.Debugf("Container image '%s' successfully downloaded", image)
}

0 comments on commit 9a4a928

Please sign in to comment.