From c337a21a4e40286811e9386a28e94ad800e93687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 3 Mar 2025 12:39:35 +0100 Subject: [PATCH] shellcheck: kata-deploy: Fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit He were fixing the few warnings we found in the files present in the functional tests for kata-deploy. Signed-off-by: Fabiano FidĂȘncio --- tests/functional/kata-deploy/gha-run.sh | 10 +++++----- tests/functional/kata-deploy/run-kata-deploy-tests.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/functional/kata-deploy/gha-run.sh b/tests/functional/kata-deploy/gha-run.sh index 744e73f1c1..f88c4f2e7d 100755 --- a/tests/functional/kata-deploy/gha-run.sh +++ b/tests/functional/kata-deploy/gha-run.sh @@ -24,9 +24,9 @@ function cleanup_runtimeclasses() { # Cleanup any runtime class that was left behind in the cluster, in # case of a test failure, apart from the default one that comes from # AKS - for rc in `kubectl get runtimeclass -o name | grep -v "kata-mshv-vm-isolation" | sed 's|runtimeclass.node.k8s.io/||'` + for rc in $(kubectl get runtimeclass -o name | grep -v "kata-mshv-vm-isolation" | sed 's|runtimeclass.node.k8s.io/||') do - kubectl delete runtimeclass $rc; + kubectl delete runtimeclass "${rc}"; done } @@ -36,8 +36,8 @@ function cleanup() { cleanup_runtimeclasses || true - if [ "${platform}" = "aks" ]; then - delete_cluster ${test_type} + if [[ "${platform}" = "aks" ]]; then + delete_cluster "${test_type}" fi } @@ -45,7 +45,7 @@ function main() { export KATA_HOST_OS="${KATA_HOST_OS:-}" platform="aks" - if [ "${KATA_HYPERVISOR}" = "qemu-tdx" ]; then + if [[ "${KATA_HYPERVISOR}" = "qemu-tdx" ]]; then platform="tdx" fi export platform diff --git a/tests/functional/kata-deploy/run-kata-deploy-tests.sh b/tests/functional/kata-deploy/run-kata-deploy-tests.sh index 39bfdfa08a..2357e557f7 100644 --- a/tests/functional/kata-deploy/run-kata-deploy-tests.sh +++ b/tests/functional/kata-deploy/run-kata-deploy-tests.sh @@ -10,8 +10,8 @@ set -e kata_deploy_dir=$(dirname "$(readlink -f "$0")") source "${kata_deploy_dir}/../../common.bash" -if [ -n "${KATA_DEPLOY_TEST_UNION:-}" ]; then - KATA_DEPLOY_TEST_UNION=($KATA_DEPLOY_TEST_UNION) +if [[ -n "${KATA_DEPLOY_TEST_UNION:-}" ]]; then + KATA_DEPLOY_TEST_UNION=("${KATA_DEPLOY_TEST_UNION}") else KATA_DEPLOY_TEST_UNION=( \ "kata-deploy.bats" \