Separate cached kubernetes binaries by OS on host machine

This way, all kubernetes binaries stored in ~/.minikube/cache/linux will be copied over to the VM and used for `minikube kubectl` on linux machines. kubectl will be stored in `~/.minikube/cache/{windows or darwin}` on windows/darwin so that `minikube kubectl` still works.
pull/6586/head
Priya Wadhwa 2020-02-11 10:58:09 -08:00
parent ff763db1e7
commit c04a0c55d6
1 changed files with 2 additions and 1 deletions
pkg/minikube/machine

View File

@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path"
"path/filepath"
"runtime"
"github.com/golang/glog"
@ -63,7 +64,7 @@ func KubernetesReleaseURLSHA1(binaryName, version, osName, archName string) stri
// CacheBinary will cache a binary on the host
func CacheBinary(binary, version, osName, archName string) (string, error) {
targetDir := localpath.MakeMiniPath("cache", version)
targetDir := localpath.MakeMiniPath(filepath.Join("cache", osName), version)
targetFilepath := path.Join(targetDir, binary)
url := KubernetesReleaseURL(binary, version, osName, archName)