diff --git a/pkg/minikube/download/download.go b/pkg/minikube/download/download.go index add8adb3b8..26ede425ee 100644 --- a/pkg/minikube/download/download.go +++ b/pkg/minikube/download/download.go @@ -34,11 +34,17 @@ import ( ) var ( + // DownloadMock is called instead of the download implementation if not nil. DownloadMock func(src, dst string) error = nil checkCache = os.Stat ) +// CreateDstDownloadMock is the default mock implementation of download. func CreateDstDownloadMock(src, dst string) error { + if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { + return errors.Wrap(err, "mkdir") + } + _, err := os.Create(dst) return err }