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

make base-image respect --image-repository #8880

Merged
merged 1 commit into from
Jul 31, 2020
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
9 changes: 6 additions & 3 deletions pkg/minikube/node/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,19 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
glog.Infof("Beginning downloading kic base image for %s with %s", cc.Driver, cc.KubernetesConfig.ContainerRuntime)
out.T(out.Pulling, "Pulling base image ...")
g.Go(func() error {
// TODO #8004 : make base-image respect --image-repository
baseImg := cc.KicBaseImage
if baseImg == kic.BaseImage && len(cc.KubernetesConfig.ImageRepository) != 0 {
baseImg = strings.Replace(baseImg, "gcr.io/k8s-minikube", cc.KubernetesConfig.ImageRepository, 1)
}
var finalImg string
// If we end up using a fallback image, notify the user
defer func() {
if finalImg != "" && finalImg != cc.KicBaseImage {
if finalImg != "" && finalImg != baseImg {
out.WarningT(fmt.Sprintf("minikube was unable to download %s, but successfully downloaded %s as a fallback image", image.Tag(cc.KicBaseImage), image.Tag(finalImg)))
cc.KicBaseImage = finalImg
}
}()
for _, img := range append([]string{cc.KicBaseImage}, kic.FallbackImages...) {
for _, img := range append([]string{baseImg}, kic.FallbackImages...) {
if err := image.LoadFromTarball(driver.Docker, img); err == nil {
glog.Infof("successfully loaded %s from cached tarball", img)
// strip the digest from the img before saving it in the config
Expand Down