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:
Miloslav Trmač 2019-01-09 21:44:05 +01:00
parent f92c3ce350
commit d559365d7a
1 changed files with 0 additions and 10 deletions

View File

@ -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 {