replace "localhost/" prefix when searching for images to support Podman

This commit is contained in:
mrex 2025-05-09 22:08:46 +02:00 committed by GitHub
parent 7a6bac85b4
commit 32875ef65f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import (
"log"
"os"
"os/exec"
"regexp"
)
var (
@ -83,8 +84,10 @@ func dockerFindImage(repository, tag string) (*dockerImage, error) {
return nil, err
}
re := regexp.MustCompile("^localhost/")
for _, im := range images {
if im.Repository == repository && im.Tag == tag {
if (im.Repository == repository || re.ReplaceAllString(im.Repository, "") == repository) && im.Tag == tag {
// found it
return &im, nil
}