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 <satoru.takeuchi@gmail.com>
This commit is contained in:
Satoru Takeuchi committed 2020-04-07 14:09:00 +00:00
1 parent f4df6f6069
commit 7bd17c4806
1 file changed
+8 -1
+8 -1
View File
@@ -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