Skip to content
Open
6 changes: 6 additions & 0 deletions pkg/minikube/download/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/blang/semver/v4"
"github.com/pkg/errors"
"github.com/spf13/viper"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/localpath"
)
Expand Down Expand Up @@ -53,6 +54,11 @@ func binaryWithChecksumURL(binaryName, version, osName, archName, binaryURL stri

// Binary will download a binary onto the host
func Binary(binary, version, osName, archName, binaryURL string) (string, error) {
// Prevent Kubernetes binary downloads in --no-kubernetes mode
if viper.GetBool("no-kubernetes") {
klog.Infof("Skipping Kubernetes binary download due to --no-kubernetes flag")
return "", nil
}
targetDir := localpath.MakeMiniPath("cache", osName, archName, version)
targetFilepath := path.Join(targetDir, binary)
targetLock := targetFilepath + ".lock"
Expand Down
5 changes: 5 additions & 0 deletions pkg/minikube/download/preload.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ var checkRemotePreloadExists = func(k8sVersion, containerRuntime string) bool {

// PreloadExists returns true if there is a preloaded tarball that can be used
func PreloadExists(k8sVersion, containerRuntime, driverName string, forcePreload ...bool) bool {
// Prevent preload logic in --no-kubernetes mode
if viper.GetBool("no-kubernetes") {
klog.Infof("Skipping preload logic due to --no-kubernetes flag")
return false
}
// TODO (#8166): Get rid of the need for this and viper at all
force := false
if len(forcePreload) > 0 {
Expand Down