Merge pull request #16214 from afbjorklund/build-registry

Add docker.io/library to image short names
pull/18364/head
Medya Ghazizadeh 2024-03-11 10:01:11 -07:00 committed by GitHub
commit 375d9c6cbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,8 @@ import (
"runtime"
"strings"
dockerref "github.com/docker/distribution/reference"
"github.com/docker/machine/libmachine/state"
"github.com/pkg/errors"
"k8s.io/klog/v2"
@ -59,6 +61,14 @@ func BuildImage(path string, file string, tag string, push bool, env []string, o
remote = false
}
if tag != "" {
named, err := dockerref.ParseNormalizedNamed(tag)
if err != nil {
return errors.Wrapf(err, "couldn't parse image reference %q", tag)
}
tag = named.String()
}
for _, p := range profiles { // building images to all running profiles
pName := p.Name // capture the loop variable