Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): export KUBECONFIG to oc only if set
Previously, when KUBECONFIG is not set, instead of oc defaulting to ~/.kube/config, it uses KUBECONFIG that points no where and tests fail as follows: ``` ❯ go test -v ./tests/e2e/... -run Node -count=1 -timeout=15m === RUN TestNodeSelector Running command cmd oc args [get node -o jsonpath={.items[*].metadata.name}] kepler_test.go:90: Error: Received unexpected error: exit status 1 Messages: failed to get node names kepler_test.go:91: Error: Should not be zero, but was 0 Messages: got zero nodes --- FAIL: TestNodeSelector (0.08s) panic: runtime error: index out of range [0] with length 0 [recovered] panic: runtime error: index out of range [0] with length 0 ``` This commit fixes the issue by exporting KUBECONFIG only if it is not empty. Signed-off-by: Sunil Thaha <sthaha@redhat.com>
- Loading branch information