fix logic in determining when to pull images

This commit is contained in:
Casey Lee 2019-03-18 16:50:23 -07:00
parent 967339e344
commit 048759a125
No known key found for this signature in database
GPG key ID: 1899120ECD0A1784

View file

@ -53,12 +53,13 @@ func (runner *runnerImpl) addImageExecutor(action *model.Action, executors *[]co
pull := runner.config.ForcePull pull := runner.config.ForcePull
if !pull { if !pull {
imageExists, err := container.ImageExistsLocally(runner.config.Ctx, image) imageExists, err := container.ImageExistsLocally(runner.config.Ctx, image)
log.Debugf("Image exists? %v", imageExists)
if err != nil { if err != nil {
return "", fmt.Errorf("unable to determine if image already exists for image %q", image) return "", fmt.Errorf("unable to determine if image already exists for image %q", image)
} }
if imageExists { if !imageExists {
pull = false pull = true
} }
} }