From 02deb1d782c89a805f7ab154c07f30ae807d9278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Wed, 19 Mar 2025 10:53:40 +0100 Subject: [PATCH] ci: shellcheck SC2248 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SC2248 (style): Prefer double quoting even when variables don't contain special characters, might result in arguments difference, shouldn't in our cases. Related to: #10951 Signed-off-by: Lukáš Doktor --- ci/openshift-ci/cluster/install_kata.sh | 4 ++-- ci/openshift-ci/run_smoke_test.sh | 12 ++++++------ ci/openshift-ci/sample-test-reproducer.sh | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ci/openshift-ci/cluster/install_kata.sh b/ci/openshift-ci/cluster/install_kata.sh index 1ab4ffbf38..a1d2ed5fa0 100755 --- a/ci/openshift-ci/cluster/install_kata.sh +++ b/ci/openshift-ci/cluster/install_kata.sh @@ -76,7 +76,7 @@ wait_for_reboot() { echo "Set timeout to ${delta} seconds" timer_start=$(date +%s) while [[ ${#workers[@]} -gt 0 ]]; do - sleep ${sleep_time} + sleep "${sleep_time}" now=$(date +%s) if [[ $((${timer_start} + ${delta})) -lt ${now} ]]; then echo "Timeout: not all workers rebooted" @@ -120,7 +120,7 @@ wait_mcp_update() { echo "Timeout: not all workers updated" >&2 return 1 fi - sleep ${sleep_time} + sleep "${sleep_time}" ready_count=$(oc get mcp worker \ -o jsonpath='{.status.readyMachineCount}') degraded_count=$(oc get mcp worker \ diff --git a/ci/openshift-ci/run_smoke_test.sh b/ci/openshift-ci/run_smoke_test.sh index 08480a41fc..7317753ab8 100755 --- a/ci/openshift-ci/run_smoke_test.sh +++ b/ci/openshift-ci/run_smoke_test.sh @@ -27,10 +27,10 @@ sleep_time=5 cmd="oc get pod/${pod} -o jsonpath='{.status.containerStatuses[0].state}' | \ grep running > /dev/null" info "Wait until the pod gets running" -waitForProcess ${wait_time} ${sleep_time} "${cmd}" || timed_out=$? +waitForProcess "${wait_time}" "${sleep_time}" "${cmd}" || timed_out=$? if [[ -n "${timed_out}" ]]; then - oc describe pod/${pod} - oc delete pod/${pod} + oc describe "pod/${pod}" + oc delete "pod/${pod}" die "${pod} not running" fi info "${pod} is running" @@ -39,7 +39,7 @@ info "${pod} is running" # hello_file=/tmp/hello hello_msg='Hello World' -oc exec ${pod} -- sh -c "echo ${hello_msg} > ${hello_file}" +oc exec "${pod}" -- sh -c "echo ${hello_msg} > ${hello_file}" info "Creating the service and route" if oc apply -f "${script_dir}/smoke/service.yaml"; then @@ -89,6 +89,6 @@ else oc delete -f "${script_dir}/smoke/service.yaml" fi info "Deleting the ${pod} pod" -oc delete pod/${pod} || test_status=$? +oc delete "pod/${pod}" || test_status=$? -exit ${test_status} +exit "${test_status}" diff --git a/ci/openshift-ci/sample-test-reproducer.sh b/ci/openshift-ci/sample-test-reproducer.sh index 73778b38bd..deee526545 100755 --- a/ci/openshift-ci/sample-test-reproducer.sh +++ b/ci/openshift-ci/sample-test-reproducer.sh @@ -37,8 +37,8 @@ echo "${E2E_TEST}" > /tmp/tsts # Remove previously-existing temporarily files as well as previous results OUT=RESULTS/tmp rm -Rf /tmp/*test* /tmp/e2e-* -rm -R ${OUT} -mkdir -p ${OUT} +rm -R "${OUT}" +mkdir -p "${OUT}" # Run the tests ignoring the monitor health checks ./openshift-tests run --provider azure -o "${OUT}/job.log" --junit-dir "${OUT}" --file /tmp/tsts --max-parallel-tests 5 --cluster-stability Disruptive RET=$?