mirror of
https://github.com/containers/podman.git
synced 2025-12-09 07:09:03 +08:00
Don't try to look up local images with an explicit :latest suffix
imageruntime.getImage, through ParseStoreReference, already uses reference.TagNameOnly on the input, so this extra lookup is completely redundant to the lookup that has already happened. Should not change behavior, apart from speeding up the code a bit. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@@ -226,7 +226,6 @@ func (i *Image) getLocalImage() (*storage.Image, error) {
|
||||
i.InputName = dest.DockerReference().String()
|
||||
}
|
||||
|
||||
var taggedName string
|
||||
img, err := i.imageruntime.getImage(stripSha256(i.InputName))
|
||||
if err == nil {
|
||||
return img.image, err
|
||||
@@ -240,15 +239,6 @@ func (i *Image) getLocalImage() (*storage.Image, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// the inputname isn't tagged, so we assume latest and try again
|
||||
if !decomposedImage.isTagged {
|
||||
taggedName = fmt.Sprintf("%s:latest", i.InputName)
|
||||
img, err = i.imageruntime.getImage(taggedName)
|
||||
if err == nil {
|
||||
return img.image, nil
|
||||
}
|
||||
}
|
||||
|
||||
// The image has a registry name in it and we made sure we looked for it locally
|
||||
// with a tag. It cannot be local.
|
||||
if decomposedImage.hasRegistry {
|
||||
|
||||
Reference in New Issue
Block a user