From 01d47d614139220472a15b0ff39f36ac0e5a582e Mon Sep 17 00:00:00 2001 From: BLasan Date: Sat, 20 Feb 2021 16:37:15 +0530 Subject: [PATCH] Fix minikube kubectl context switching --- cmd/minikube/cmd/kubectl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/minikube/cmd/kubectl.go b/cmd/minikube/cmd/kubectl.go index 61e5f2ffdb22..64fbc7978833 100644 --- a/cmd/minikube/cmd/kubectl.go +++ b/cmd/minikube/cmd/kubectl.go @@ -43,6 +43,10 @@ minikube kubectl -- get pods --namespace kube-system`, co := mustload.Healthy(ClusterFlagValue()) version := co.Config.KubernetesConfig.KubernetesVersion + + cluster := []string{"--cluster", ClusterFlagValue()} + args = append(args, cluster...) + c, err := KubectlCommand(version, args...) if err != nil { out.ErrLn("Error caching kubectl: %v", err)