diff --git a/pkg/minikube/node/cache.go b/pkg/minikube/node/cache.go index 40432c7c03..fbd53889bf 100644 --- a/pkg/minikube/node/cache.go +++ b/pkg/minikube/node/cache.go @@ -136,6 +136,7 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down }() for _, img := range append([]string{baseImg}, kic.FallbackImages...) { var err error + var isFromCache bool if driver.IsDocker(cc.Driver) && download.ImageExistsInDaemon(img) && !downloadOnly { klog.Infof("%s exists in daemon, skipping load", img) @@ -161,20 +162,21 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down err = download.CacheToDaemon(img) if err == nil { klog.Infof("successfully loaded %s from cached tarball", img) - finalImg = img - return nil + isFromCache = true } } if driver.IsDocker(cc.Driver) { - klog.Infof("failed to load %s, will try remote image if available: %v", img, err) - klog.Infof("Downloading %s to local daemon", img) err = download.ImageToDaemon(img) if err == nil { klog.Infof("successfully downloaded %s", img) finalImg = img return nil + } else if isFromCache { + klog.Infof("use image loaded from cache %s", strings.Split(img, "@")[0]) + finalImg = strings.Split(img, "@")[0] + return nil } } klog.Infof("failed to download %s, will try fallback image if available: %v", img, err)