From 7bd17c4806fa23cd5f0084a1226243ba4ca802c8 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Thu, 5 Mar 2020 23:31:11 +0900 Subject: [PATCH] tests: fix minor bugs - `helm_read` is not a command, but a variable - If `helm` was installed in `helm.sh up`, the following `heml.sh clean` fails since `helm_rest` can't find the installed `helm`. Signed-off-by: Satoru Takeuchi --- tests/scripts/helm.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/scripts/helm.sh b/tests/scripts/helm.sh index 513ea9666..3f949c8aa 100755 --- a/tests/scripts/helm.sh +++ b/tests/scripts/helm.sh @@ -59,7 +59,7 @@ install() { sleep 10 (( ++INC )) helm_ready=$(kubectl get pods -l app=helm -n kube-system -o jsonpath='{.items[0].status.phase}') - echo "helm pod status: $(helm_ready)" + echo "helm pod status: ${helm_ready}" done if [ "${helm_ready}" != "Running" ]; then @@ -83,6 +83,13 @@ install() { } helm_reset() { + if ! helm_loc="$(type -p "helm")" || [[ -z ${helm_loc} ]]; then + local dist + dist="$(uname -s)" + # shellcheck disable=SC2021 + dist=$(echo "${dist}" | tr "[A-Z]" "[a-z]") + HELM="${temp}/${dist}-${arch}/helm" + fi "${HELM}" reset # shellcheck disable=SC2021 pgrep "${HELM}" | grep -v grep | awk '{print $2}'| xargs kill -9