this attempts to resolve

https://github.com/kubernetes/minikube/issues/2768
for Windows, by converting \ in directory string to / and using
`path.Join` instead of `filepath.Join` which uses Unix format
instead of using he current OS directory delimeter.
pull/3258/head
Nicholas Irving 2018-10-16 22:12:52 +11:00
parent c01c5545a5
commit c05b9697f1
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"path"
"strconv" "strconv"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -305,7 +306,8 @@ func addMinikubeDirToAssets(basedir, vmpath string, assets *[]CopyableFile) erro
return errors.Wrap(err, "generating relative path") return errors.Wrap(err, "generating relative path")
} }
rPath = filepath.Dir(rPath) rPath = filepath.Dir(rPath)
vmpath = filepath.Join("/", rPath) rPath = filepath.ToSlash(rPath)
vmpath = path.Join("/", rPath)
} }
permString := fmt.Sprintf("%o", info.Mode().Perm()) permString := fmt.Sprintf("%o", info.Mode().Perm())
// The conversion will strip the leading 0 if present, so add it back // The conversion will strip the leading 0 if present, so add it back