Skip to content

Commit

Permalink
DO NOT MERGE: test dropping loose digest lookups
Browse files Browse the repository at this point in the history
Only for getting feedback from Podman and Buildah CI for now.
See containers/issues/1248 for details.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Jun 14, 2023
1 parent 93be4a8 commit e521403
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions libimage/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,25 +437,27 @@ func (r *Runtime) lookupImageInDigestsAndRepoTags(name string, options *LookupIm
return nil, "", fmt.Errorf("%s: %w", name, storage.ErrImageUnknown)
}

digested, isDigested := named.(reference.Digested)
if isDigested {
logrus.Debug("Looking for image with matching recorded digests")
digest := digested.Digest()
for _, image := range allImages {
for _, d := range image.Digests() {
if d != digest {
continue
}
// Also make sure that the matching image fits all criteria (e.g., manifest list).
if _, err := r.lookupImageInLocalStorage(name, image.ID(), options); err != nil {
return nil, "", err
}
return image, name, nil

}
}
return nil, "", fmt.Errorf("%s: %w", name, storage.ErrImageUnknown)
}
// FIXME
//
// digested, isDigested := named.(reference.Digested)
// if isDigested {
// logrus.Debug("Looking for image with matching recorded digests")
// digest := digested.Digest()
// for _, image := range allImages {
// for _, d := range image.Digests() {
// if d != digest {
// continue
// }
// // Also make sure that the matching image fits all criteria (e.g., manifest list).
// if _, err := r.lookupImageInLocalStorage(name, image.ID(), options); err != nil {
// return nil, "", err
// }
// return image, name, nil
//
// }
// }
// return nil, "", fmt.Errorf("%s: %w", name, storage.ErrImageUnknown)
// }

if !shortnames.IsShortName(name) {
return nil, "", fmt.Errorf("%s: %w", name, storage.ErrImageUnknown)
Expand Down

0 comments on commit e521403

Please sign in to comment.