From c47011f1123a61e6ef08ecd904fd47388cc16a23 Mon Sep 17 00:00:00 2001 From: Pavel Tankov <4014969+ptankov@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:45:15 +0300 Subject: [PATCH] CLOUD-789-2 converting variables in a function to local (#525) --- e2e-tests/functions | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e2e-tests/functions b/e2e-tests/functions index ef4c97b865..b1035cba88 100644 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -422,13 +422,22 @@ get_pod_by_role() { } check_passwords_leak() { + local secrets + local passwords + local pods - secrets=$(kubectl -n "${NAMESPACE}" get secrets -o json | jq -r '.items[] | select(.data."password"? != null) | .data."password"' ; kubectl -n "${NAMESPACE}" get secrets -o json | jq -r '.items[] | select(.data."pgbouncer-password"? != null) | .data."pgbouncer-password"') + secrets=$( + kubectl -n "${NAMESPACE}" get secrets -o json | jq -r '.items[] | select(.data."password"? != null) | .data."password"' + kubectl -n "${NAMESPACE}" get secrets -o json | jq -r '.items[] | select(.data."pgbouncer-password"? != null) | .data."pgbouncer-password"' + ) passwords="$(for i in $secrets; do base64 -d <<< $i; echo; done) $secrets" pods=$(kubectl -n "${NAMESPACE}" get pods -o name | awk -F "/" '{print $2}') collect_logs() { + local containers + local count + NS=$1 for p in $pods; do containers=$(kubectl -n "$NS" get pod $p -o jsonpath='{.spec.containers[*].name}')