log error

This commit is contained in:
Benjamin Elder
2018-09-26 20:28:49 -07:00
parent 1c43d5464f
commit e7c4dde27a

View File

@@ -44,7 +44,7 @@ func PullIfNotPresent(image string, retries int) (pulled bool, err error) {
if err != nil {
for i := 0; i < retries; i++ {
time.Sleep(time.Second * time.Duration(i+1))
log.Infof("Trying again to pull image: %s ...", image)
log.WithError(err).Infof("Trying again to pull image: %s ...", image)
// TODO(bentheelder): add some backoff / sleep?
err = exec.Command("docker", "pull", image).Run()
if err == nil {
@@ -53,7 +53,7 @@ func PullIfNotPresent(image string, retries int) (pulled bool, err error) {
}
}
if err != nil {
log.Infof("Failed to pull image: %s", image)
log.WithError(err).Infof("Failed to pull image: %s", image)
}
return true, err
}