From b568c7f7d839509c40b94df38d9abc5ad41fd80d Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Tue, 4 Jul 2023 14:28:29 +0200 Subject: [PATCH] tests/integration: Provide default value for KATA_HOST_OS Non AKS k8s tests (SEV/SNP/TDX) don't currently set KATA_HOST_OS, so provide a default empty value for the variable so that those tests can run. Signed-off-by: Jeremi Piotrowski --- tests/integration/gha-run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration/gha-run.sh b/tests/integration/gha-run.sh index 6abdafae2e..cdbce7211c 100755 --- a/tests/integration/gha-run.sh +++ b/tests/integration/gha-run.sh @@ -68,8 +68,10 @@ function run_tests() { ensure_yq sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${DOCKER_REGISTRY}/${DOCKER_REPO}:${DOCKER_TAG}|g" "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" - yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[+].name' "HOST_OS" - yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[-1].value' "${KATA_HOST_OS}" + if [ "${KATA_HOST_OS}" = "cbl-mariner" ]; then + yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[+].name' "HOST_OS" + yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[-1].value' "${KATA_HOST_OS}" + fi cat "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" cat "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" | grep "${DOCKER_REGISTRY}/${DOCKER_REPO}:${DOCKER_TAG}" || die "Failed to setup the tests image" @@ -131,6 +133,8 @@ function delete_cluster() { } function main() { + export KATA_HOST_OS="${KATA_HOST_OS:-}" + action="${1:-}" case "${action}" in