diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 3b98bb51e764..c27d7e84ea36 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -19,7 +19,7 @@ package cruntime import ( "fmt" "os/exec" - "path/filepath" + "path" "strings" "time" @@ -272,7 +272,9 @@ func (r *Docker) SystemLogCmd(len int) string { // 3. Remove the tarball within the VM func (r *Docker) Preload(k8sVersion string) error { tarballPath := download.TarballPath(k8sVersion) - dest := "/preloaded.tar.lz4" + targetDir := "/" + targetName := "preloaded.tar.lz4" + dest := path.Join(targetDir, targetName) c := exec.Command("which", "lz4") if _, err := r.Runner.RunCmd(c); err != nil { @@ -280,7 +282,7 @@ func (r *Docker) Preload(k8sVersion string) error { } // Copy over tarball into host - fa, err := assets.NewFileAsset(tarballPath, filepath.Dir(dest), filepath.Base(dest), "0644") + fa, err := assets.NewFileAsset(tarballPath, targetDir, targetName, "0644") if err != nil { return errors.Wrap(err, "getting file asset") }