From aca670aa5fdabb99bef695bddd3dfbd56a51a974 Mon Sep 17 00:00:00 2001 From: "Yasin, Sirajudeen (SY495P)" Date: Tue, 13 Aug 2019 06:59:50 -0700 Subject: [PATCH] [debug-report-fix] - set KUBECONFIG env When running kubectl command from ssh_cmd, the env variable KUBECONFIG is not visible and so the kubectl commands are failing with below error "The connection to the server localhost:8080 was refused - did you specify the right host or port?" Change-Id: I453f95b745a914aad5c608c5e5f625056e516add --- .../multi_nodes_gate/airship_gate/stages/debug-report-lite.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/multi_nodes_gate/airship_gate/stages/debug-report-lite.sh b/tools/multi_nodes_gate/airship_gate/stages/debug-report-lite.sh index f30f0225..9e392574 100755 --- a/tools/multi_nodes_gate/airship_gate/stages/debug-report-lite.sh +++ b/tools/multi_nodes_gate/airship_gate/stages/debug-report-lite.sh @@ -17,6 +17,8 @@ set -ex source "${GATE_UTILS}" +export KUBECONFIG="${KUBECONFIG:-/etc/kubernetes/admin/kubeconfig.yaml}" + ssh_cmd "${GENESIS_NAME}" apt-get install -y jq # Copies script and virtmgr private key to genesis VM @@ -24,7 +26,7 @@ ssh_cmd "${GENESIS_NAME}" mkdir -p /root/airship rsync_cmd "${REPO_ROOT}/tools/multi_nodes_gate/airship_gate/bin/debug-report-lite.sh" "${GENESIS_NAME}:/root/airship/" set -o pipefail -ssh_cmd "${GENESIS_NAME}" /root/airship/debug-report-lite.sh 2>&1 | tee -a "${LOG_FILE}" +ssh_cmd_raw "${GENESIS_NAME}" "KUBECONFIG=${KUBECONFIG} /root/airship/debug-report-lite.sh" 2>&1 | tee -a "${LOG_FILE}" set +o pipefail rsync_cmd "${GENESIS_NAME}:/root/debug-${GENESIS_NAME}.tgz" .