From 95333ed1fe97f35b36098cbcc01baee12094695c Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 17 Jun 2021 15:01:11 -0700 Subject: [PATCH] Move daemon cache check before file cache check so cache doesn't need to be repopulated if daemon is already present. --- pkg/minikube/node/cache.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/minikube/node/cache.go b/pkg/minikube/node/cache.go index 30aade94cab5..e05e78819864 100644 --- a/pkg/minikube/node/cache.go +++ b/pkg/minikube/node/cache.go @@ -131,6 +131,15 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down }() for _, img := range append([]string{baseImg}, kic.FallbackImages...) { var err error + + if driver.IsDocker(cc.Driver) { + if download.ImageExistsInDaemon(img) { + klog.Infof("%s exists in daemon, skipping load", img) + finalImg = img + return nil + } + } + klog.Infof("Downloading %s to local cache", img) err = download.ImageToCache(img) if err == nil { @@ -141,14 +150,6 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down return err } - if driver.IsDocker(cc.Driver) { - if download.ImageExistsInDaemon(img) { - klog.Infof("%s exists in daemon, skipping load", img) - finalImg = img - return nil - } - } - if cc.Driver == driver.Podman { return fmt.Errorf("not yet implemented, see issue #8426") }