From 97cc383de0171ba762de00f75ea7720fa6d3b72f Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 11 Mar 2020 14:18:29 -0700 Subject: [PATCH 1/2] Avoid cache loading for the none driver, Docker already has a cache --- pkg/minikube/node/config.go | 4 +++- pkg/minikube/node/start.go | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/node/config.go b/pkg/minikube/node/config.go index e93a7fc4d87b..654b2692c8d2 100644 --- a/pkg/minikube/node/config.go +++ b/pkg/minikube/node/config.go @@ -66,7 +66,9 @@ func configureRuntimes(runner cruntime.CommandRunner, drvName string, k8s config if driver.BareMetal(drvName) { disableOthers = false } - if !driver.IsKIC(drvName) { + + // Preload is overly invasive for VM's, and caching is not meaningful. + if driver.IsVM(drvName) { if err := cr.Preload(k8s.KubernetesVersion); err != nil { switch err.(type) { case *cruntime.ErrISOFeature: diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 8dfbde664360..ad8e5e42e4b1 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -44,7 +44,10 @@ func Start(mc config.ClusterConfig, n config.Node, primary bool, existingAddons } var cacheGroup errgroup.Group - beginCacheKubernetesImages(&cacheGroup, mc.KubernetesConfig.ImageRepository, k8sVersion, mc.KubernetesConfig.ContainerRuntime) + // Adding a second layer of cache does not make sense for the none driver + if !driver.BareMetal(driverName) { + beginCacheKubernetesImages(&cacheGroup, mc.KubernetesConfig.ImageRepository, k8sVersion, mc.KubernetesConfig.ContainerRuntime) + } // Abstraction leakage alert: startHost requires the config to be saved, to satistfy pkg/provision/buildroot. // Hence, saveConfig must be called before startHost, and again afterwards when we know the IP. From 8a132547c81f829711e0600fea962c6d4fb003cc Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 11 Mar 2020 14:21:19 -0700 Subject: [PATCH 2/2] Clarify comment --- pkg/minikube/node/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/node/config.go b/pkg/minikube/node/config.go index 654b2692c8d2..d9500b276750 100644 --- a/pkg/minikube/node/config.go +++ b/pkg/minikube/node/config.go @@ -67,7 +67,7 @@ func configureRuntimes(runner cruntime.CommandRunner, drvName string, k8s config disableOthers = false } - // Preload is overly invasive for VM's, and caching is not meaningful. + // Preload is overly invasive for bare metal, and caching is not meaningful. if driver.IsVM(drvName) { if err := cr.Preload(k8s.KubernetesVersion); err != nil { switch err.(type) {