Skip to content

Commit 43733c6

Browse files
ravisantoshgudimetlahasbro17
authored andcommitted
Fix kubeconfig pointer exception (#796)
1 parent 05a578b commit 43733c6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

hack/tests/test-subcommand.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ kubectl create namespace test-memcached
2121
operator-sdk test local ./test/e2e --up-local --namespace=test-memcached
2222
kubectl delete namespace test-memcached
2323

24+
# test operator in up local mode with kubeconfig
25+
kubectl create namespace test-memcached
26+
operator-sdk test local ./test/e2e --up-local --namespace=test-memcached --kubeconfig $HOME/.kube/config
27+
kubectl delete namespace test-memcached
28+
2429
# test operator in no-setup mode
2530
kubectl create namespace test-memcached
2631
kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml

pkg/test/main_entry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func MainEntry(m *testing.M) {
8080
os.Exit(0)
8181
}()
8282
if *kubeconfigPath != "" {
83-
localCmd.Env = append(os.Environ(), fmt.Sprintf("%v=%v", k8sutil.KubeConfigEnvVar, kubeconfigPath))
83+
localCmd.Env = append(os.Environ(), fmt.Sprintf("%v=%v", k8sutil.KubeConfigEnvVar, *kubeconfigPath))
8484
} else {
8585
// we can hardcode index 0 as that is the highest priority kubeconfig to be loaded and will always
8686
// be populated by NewDefaultClientConfigLoadingRules()

0 commit comments

Comments
 (0)