From b92f3160a7156251d921bc85ab3276557210e367 Mon Sep 17 00:00:00 2001 From: Samuel Karp Date: Mon, 19 Sep 2022 18:51:15 -0700 Subject: [PATCH] cri-integration: propagate ENABLE_CRI_SANDBOXES sudo(8) strips environment variables by default. Explicitly set ENABLE_CRI_SANDBOXES so we can ensure we test the sbserver CRI implementation. Signed-off-by: Samuel Karp --- script/test/utils.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/test/utils.sh b/script/test/utils.sh index 595617813..4c45f25f0 100755 --- a/script/test/utils.sh +++ b/script/test/utils.sh @@ -165,8 +165,12 @@ run_containerd() { local report_dir=$1 fi CMD="" - if [ ! -z "${sudo}" ]; then + if [ -n "${sudo}" ]; then CMD+="${sudo} " + # sudo strips environment variables, so add ENABLE_CRI_SANDBOXES back if present + if [ -n "${ENABLE_CRI_SANDBOXES}" ]; then + CMD+="ENABLE_CRI_SANDBOXES='${ENABLE_CRI_SANDBOXES}' " + fi fi CMD+="${PWD}/bin/containerd"