From fea9fd39a06b2da7772ece669261feaa36175b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 7 Mar 2020 16:27:09 +0100 Subject: [PATCH] Check if lz4 is available before trying to use it --- pkg/minikube/cruntime/docker.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 8033a5de00d1..3b98bb51e764 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -274,6 +274,11 @@ func (r *Docker) Preload(k8sVersion string) error { tarballPath := download.TarballPath(k8sVersion) dest := "/preloaded.tar.lz4" + c := exec.Command("which", "lz4") + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrapf(err, "check lz4 available.") + } + // Copy over tarball into host fa, err := assets.NewFileAsset(tarballPath, filepath.Dir(dest), filepath.Base(dest), "0644") if err != nil {