Skip to content

Commit b21e5dc

Browse files
committed
e2e: Add support for overriding the kubectl binary when gather artifacts
Signed-off-by: timflannagan <[email protected]>
1 parent 34a82f9 commit b21e5dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: test/e2e/collect-ci-artifacts.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ set -o errexit
77
: "${KUBECONFIG:?}"
88
: "${TEST_NAMESPACE:?}"
99
: "${TEST_ARTIFACTS_DIR:?}"
10+
: "${KUBECTL:=kubectl}"
1011

12+
echo "Using the ${KUBECTL} kubectl binary"
13+
echo "Using the ${TEST_ARTIFACTS_DIR} output directory"
1114
mkdir -p "${TEST_ARTIFACTS_DIR}"
1215

1316
commands=()
@@ -23,5 +26,5 @@ echo "Storing the test artifact output in the ${TEST_ARTIFACTS_DIR} directory"
2326
for command in "${commands[@]}"; do
2427
echo "Collecting ${command} output..."
2528
COMMAND_OUTPUT_FILE=${TEST_ARTIFACTS_DIR}/${command// /_}
26-
kubectl -n ${TEST_NAMESPACE} ${command} >> "${COMMAND_OUTPUT_FILE}"
29+
${KUBECTL} -n ${TEST_NAMESPACE} ${command} >> "${COMMAND_OUTPUT_FILE}"
2730
done

Diff for: test/e2e/ctx/ctx.go

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func (ctx TestContext) DumpNamespaceArtifacts(namespace string) error {
131131
"TEST_NAMESPACE=" + namespace,
132132
"TEST_ARTIFACTS_DIR=" + logDir,
133133
"KUBECONFIG=" + kubeconfigPath,
134+
"KUBECTL=" + os.Getenv("KUBECTL"),
134135
}
135136

136137
cmd := exec.Command(ctx.artifactsScriptPath)

0 commit comments

Comments
 (0)