Skip to content

Commit acfd8b7

Browse files
committed
Added No-kubernetes flag check in TransferBinaries Function and also used GOOS to get the current OS
1 parent cbd40f5 commit acfd8b7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/minikube/bootstrapper/bsutil/binaries.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"strings"
2626

2727
"github.com/pkg/errors"
28+
"github.com/spf13/viper"
2829
"golang.org/x/sync/errgroup"
2930

3031
"k8s.io/klog/v2"
@@ -39,6 +40,12 @@ import (
3940

4041
// TransferBinaries transfers all required Kubernetes binaries
4142
func TransferBinaries(cfg config.KubernetesConfig, c command.Runner, sm sysinit.Manager, binariesURL string) error {
43+
// Skip binary transfer in --no-kubernetes mode
44+
if viper.GetBool("no-kubernetes") {
45+
klog.Info("Skipping Kubernetes binary transfer due to --no-kubernetes flag")
46+
return nil
47+
}
48+
4249
ok, err := binariesExist(cfg, c)
4350
if err == nil && ok {
4451
klog.Info("Found k8s binaries, skipping transfer")

test/integration/no_kubernetes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestNoKubernetes(t *testing.T) {
8585
func VerifyNoK8sDownloadCache(ctx context.Context, t *testing.T, profile string) {
8686
defer PostMortemLogs(t, profile)
8787

88-
cachePath := filepath.Join(localpath.MiniPath(), "cache", "linux", runtime.GOARCH, "v0.0.0")
88+
cachePath := filepath.Join(localpath.MiniPath(), "cache", runtime.GOOS, runtime.GOARCH, constants.NoKubernetesVersion)
8989

9090
// Check if the cache directory exists at all
9191
t.Logf("Checking cache directory: %s", cachePath)

0 commit comments

Comments
 (0)