Skip to content

Commit

Permalink
Don't fall back if imagesIDsForManifest fails
Browse files Browse the repository at this point in the history
If we can't find the image we have just pulled by digest, the image
was probably already removed, and returning candidate.Value
could only possibly point at a _different_ image with the same
tag.

Instead, fail immediately.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Oct 15, 2024
1 parent d020acd commit 4cf7957
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,11 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
}

logrus.Debugf("Pulled candidate %s successfully", candidateString)
if ids, err := r.imagesIDsForManifest(manifestBytes, sys); err == nil {
return ids, nil
ids, err := r.imagesIDsForManifest(manifestBytes, sys)
if err != nil {
return nil, err
}
return []string{candidate.Value.String()}, nil
return ids, nil
}

if localImage != nil && pullPolicy == config.PullPolicyNewer {
Expand Down

0 comments on commit 4cf7957

Please sign in to comment.