diff --git a/commands/operator-sdk/cmd/up/local.go b/commands/operator-sdk/cmd/up/local.go index b712f2255a..7355e149cf 100644 --- a/commands/operator-sdk/cmd/up/local.go +++ b/commands/operator-sdk/cmd/up/local.go @@ -126,6 +126,8 @@ func upLocal() { } func upLocalAnsible() { + // Set the kubeconfig that the manager will be able to grab + os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig) mgr, err := manager.New(config.GetConfigOrDie(), manager.Options{Namespace: namespace}) if err != nil { log.Fatal(err) diff --git a/pkg/k8sutil/constants.go b/pkg/k8sutil/constants.go index d5b75cd39e..0ac85c02cc 100644 --- a/pkg/k8sutil/constants.go +++ b/pkg/k8sutil/constants.go @@ -15,9 +15,9 @@ package k8sutil const ( - // KubeConfigEnvVar defines the env variable KUBERNETES_CONFIG which + // KubeConfigEnvVar defines the env variable KUBECONFIG which // contains the kubeconfig file path. - KubeConfigEnvVar = "KUBERNETES_CONFIG" + KubeConfigEnvVar = "KUBECONFIG" // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which is the namespace that the pod is currently running in.