Skip to content

Commit fa20007

Browse files
author
Shawn Hurley
authored
pkg/k8sutil,cmd/up/local: Fixing kubeconfig environment variable. (#705)
1 parent 0af00eb commit fa20007

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

commands/operator-sdk/cmd/up/local.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ func upLocal() {
126126
}
127127

128128
func upLocalAnsible() {
129+
// Set the kubeconfig that the manager will be able to grab
130+
os.Setenv(k8sutil.KubeConfigEnvVar, kubeConfig)
129131
mgr, err := manager.New(config.GetConfigOrDie(), manager.Options{Namespace: namespace})
130132
if err != nil {
131133
log.Fatal(err)

pkg/k8sutil/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
package k8sutil
1616

1717
const (
18-
// KubeConfigEnvVar defines the env variable KUBERNETES_CONFIG which
18+
// KubeConfigEnvVar defines the env variable KUBECONFIG which
1919
// contains the kubeconfig file path.
20-
KubeConfigEnvVar = "KUBERNETES_CONFIG"
20+
KubeConfigEnvVar = "KUBECONFIG"
2121

2222
// WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
2323
// which is the namespace that the pod is currently running in.

0 commit comments

Comments
 (0)