Skip to content

Commit

Permalink
Merge pull request #6968 from priyawadhwa/windows-bug
Browse files Browse the repository at this point in the history
preload: fix bug for windows file separators
  • Loading branch information
medyagh authored Mar 9, 2020
2 parents 35210f9 + eb815a7 commit 08ae3fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/minikube/cruntime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cruntime
import (
"fmt"
"os/exec"
"path/filepath"
"path"
"strings"
"time"

Expand Down Expand Up @@ -272,15 +272,17 @@ 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 {
return errors.Wrapf(err, "check lz4 available.")
}

// 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")
}
Expand Down

0 comments on commit 08ae3fc

Please sign in to comment.