From c5f59c5a12220c525bea48d783d476527fe6b9c5 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 27 May 2021 21:33:49 +0200 Subject: [PATCH] prow.sh: allow shell commands in CSI_PROW_SANITY_POD This is required for distributed provisioning where the Pod name is dynamically generated as part of the DaemonSet. --- prow.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/prow.sh b/prow.sh index f4e0dcc4d..1d0732fd8 100755 --- a/prow.sh +++ b/prow.sh @@ -996,9 +996,17 @@ run_e2e () ( run_sanity () ( install_sanity || die "installing csi-sanity failed" + if [[ "${CSI_PROW_SANITY_POD}" =~ " " ]]; then + # Contains spaces, more complex than a simple pod name. + # Evaluate as a shell command. + pod=$(eval "${CSI_PROW_SANITY_POD}") || die "evaluation failed: CSI_PROW_SANITY_POD=${CSI_PROW_SANITY_POD}" + else + pod="${CSI_PROW_SANITY_POD}" + fi + cat >"${CSI_PROW_WORK}/mkdir_in_pod.sh" <"${CSI_PROW_WORK}/rmdir_in_pod.sh" <