Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker.io/library to image short names #16214

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/minikube/machine/build_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
Loading