From b08c019003b20b31e715503a92f66ab4e8b237c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Thu, 20 Jun 2024 11:12:10 +0200 Subject: [PATCH] ci.ocp: Ensure we smoke-test with the right runtime class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we do encourage people to set the KATA_RUNTIME, but it is only used by the webhook. Let's define it in the main `test.sh` and use it in the smoke test to ensure the user-defined runtime is smoke-tested rather than hard-coded kata-qemu one. Related to: #9804 Signed-off-by: Lukáš Doktor --- ci/openshift-ci/run_smoke_test.sh | 4 +++- .../smoke/{http-server.yaml => http-server.yaml.in} | 2 +- ci/openshift-ci/test.sh | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) rename ci/openshift-ci/smoke/{http-server.yaml => http-server.yaml.in} (94%) diff --git a/ci/openshift-ci/run_smoke_test.sh b/ci/openshift-ci/run_smoke_test.sh index d2639bb139..1558fbc937 100755 --- a/ci/openshift-ci/run_smoke_test.sh +++ b/ci/openshift-ci/run_smoke_test.sh @@ -15,7 +15,9 @@ pod='http-server' # Create a pod. # info "Creating the ${pod} pod" -oc apply -f ${script_dir}/smoke/${pod}.yaml || \ +[ -z "$KATA_RUNTIME" ] && die "Please set the KATA_RUNTIME first" +envsubst < "${script_dir}/smoke/${pod}.yaml.in" | \ + oc apply -f - || \ die "failed to create ${pod} pod" # Check it eventually goes to 'running' diff --git a/ci/openshift-ci/smoke/http-server.yaml b/ci/openshift-ci/smoke/http-server.yaml.in similarity index 94% rename from ci/openshift-ci/smoke/http-server.yaml rename to ci/openshift-ci/smoke/http-server.yaml.in index ce73ad9ffb..e993ce3c8b 100644 --- a/ci/openshift-ci/smoke/http-server.yaml +++ b/ci/openshift-ci/smoke/http-server.yaml.in @@ -27,4 +27,4 @@ spec: runAsUser: 1000 seccompProfile: type: RuntimeDefault - runtimeClassName: kata-qemu + runtimeClassName: ${KATA_RUNTIME} diff --git a/ci/openshift-ci/test.sh b/ci/openshift-ci/test.sh index be661ecbd3..4347e6c27f 100755 --- a/ci/openshift-ci/test.sh +++ b/ci/openshift-ci/test.sh @@ -5,6 +5,9 @@ # SPDX-License-Identifier: Apache-2.0 # +# The kata shim to be used +export KATA_RUNTIME=${KATA_RUNTIME:-kata-qemu} + script_dir=$(dirname $0) source ${script_dir}/lib.sh