From f0858c584346dac2fa3c496aeac581a88319dcb1 Mon Sep 17 00:00:00 2001 From: yivantsov-atlassian <52448429+bianchi2@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:01:26 +1000 Subject: [PATCH] Skip using sudo if command does not exist (#829) Co-authored-by: Yevhen Ivantsov --- src/test/scripts/kind/create_kind.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/scripts/kind/create_kind.sh b/src/test/scripts/kind/create_kind.sh index 1691f417e..fea446316 100755 --- a/src/test/scripts/kind/create_kind.sh +++ b/src/test/scripts/kind/create_kind.sh @@ -10,7 +10,8 @@ if [ -z "${SKIP_DOWNLOAD_KIND}" ]; then echo "[INFO]: Downloading KinD ${KIND_VERSION}" curl -Lo ./kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-$(uname)-amd64" chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + SUDO=$(which sudo) + ${SUDO} mv ./kind /usr/local/bin/kind fi echo "[INFO]: Using config file src/test/config/kind/kind-config.yml"