ci.ocp: Fix incorrectly quoted argument

with the shellcheck fixes we accidentally quoted the "-n NAMESPACE"
argument where we should have used array instead, which lead to oc
considering this as a pod name and returning error.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
This commit is contained in:
Lukáš Doktor 2025-08-01 08:19:08 +02:00
parent 82f141a02e
commit 60ed6423fd
No known key found for this signature in database
GPG Key ID: 26B362E47FCF22C1

View File

@ -174,13 +174,13 @@ wait_for_app_pods_message() {
local namespace="$5" local namespace="$5"
[[ -z "${pod_count}" ]] && pod_count=1 [[ -z "${pod_count}" ]] && pod_count=1
[[ -z "${timeout}" ]] && timeout=60 [[ -z "${timeout}" ]] && timeout=60
[[ -n "${namespace}" ]] && namespace=" -n ${namespace} " [[ -n "${namespace}" ]] && namespace=("-n" "${namespace}")
local pod local pod
local pods local pods
local i local i
SECONDS=0 SECONDS=0
while :; do while :; do
mapfile -t pods < <(oc get pods -l app="${app}" --no-headers=true "${namespace}" | awk '{print $1}') mapfile -t pods < <(oc get pods -l app="${app}" --no-headers=true "${namespace[@]}" | awk '{print $1}')
[[ "${#pods}" -ge "${pod_count}" ]] && break [[ "${#pods}" -ge "${pod_count}" ]] && break
if [[ "${SECONDS}" -gt "${timeout}" ]]; then if [[ "${SECONDS}" -gt "${timeout}" ]]; then
printf "Unable to find ${pod_count} pods for '-l app=\"${app}\"' in ${SECONDS}s (%s)" "${pods[@]}" printf "Unable to find ${pod_count} pods for '-l app=\"${app}\"' in ${SECONDS}s (%s)" "${pods[@]}"