Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preload: fix bug for windows file separators #6968

Merged
merged 2 commits into from
Mar 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkg/minikube/cruntime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package cruntime
import (
"fmt"
"os/exec"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -272,15 +271,19 @@ 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"
// don't use filepath.Join so that we maintain Linux file separators
// so that this still works on Windows
dest := targetDir + targetName
priyawadhwa marked this conversation as resolved.
Show resolved Hide resolved

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