Skip to content

Commit

Permalink
Merge pull request #6928 from priyawadhwa/preload-bug
Browse files Browse the repository at this point in the history
Block on preload download before extracting, fall back to caching images if it fails
  • Loading branch information
medyagh authored Mar 7, 2020
2 parents 7e5688b + 095fd2a commit 2fe6b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/minikube/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/kubeconfig"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/util/lock"
)
Expand Down Expand Up @@ -67,7 +68,10 @@ func configureRuntimes(runner cruntime.CommandRunner, drvName string, k8s config
}
if !driver.IsKIC(drvName) {
if err := cr.Preload(k8s.KubernetesVersion); err != nil {
glog.Infof("Failed to preload container runtime %s: %v", cr.Name(), err)
glog.Errorf("Failed to preload container runtime %s: %v, falling back to caching images", cr.Name(), err)
if err := machine.CacheImagesForBootstrapper(k8s.ImageRepository, k8s.KubernetesVersion, viper.GetString(cmdcfg.Bootstrapper)); err != nil {
exit.WithError("Failed to cache images", err)
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ func Start(mc config.ClusterConfig, n config.Node, primary bool, existingAddons
mRunner, preExists, machineAPI, host := startMachine(&mc, &n)
defer machineAPI.Close()

// wait for preloaded tarball to finish downloading before configuring runtimes
waitCacheRequiredImages(&cacheGroup)

// configure the runtime (docker, containerd, crio)
cr := configureRuntimes(mRunner, driverName, mc.KubernetesConfig)
showVersionInfo(k8sVersion, cr)
waitCacheRequiredImages(&cacheGroup)

//TODO(sharifelgamal): Part out the cluster-wide operations, perhaps using the "primary" param

Expand Down

0 comments on commit 2fe6b61

Please sign in to comment.