From 40c46c75eda27e0db5fd1802f26e659c1242620b Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Mon, 3 Jul 2023 16:43:55 +0200 Subject: [PATCH] tests/integration: Perform yq install in run_tests() We only need to install in run_tests() so that the yq install is picked up by kubernets/setup.sh as well. We also need to either use (sudo && INSTALL_IN_GOPATH=false) || (INSTALL_IN_GOPATH=true). Signed-off-by: Jeremi Piotrowski --- tests/integration/gha-run.sh | 10 ++++++++-- tests/integration/kubernetes/setup.sh | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/integration/gha-run.sh b/tests/integration/gha-run.sh index b2493e3b9..8fb6c14fa 100755 --- a/tests/integration/gha-run.sh +++ b/tests/integration/gha-run.sh @@ -56,10 +56,16 @@ function get_cluster_credentials() { -n "$(_print_cluster_name)" } -function run_tests() { - INSTALL_IN_GOPATH=false bash "${repo_root_dir}/ci/install_yq.sh" +function ensure_yq() { + : "${GOPATH:=${GITHUB_WORKSPACE}}" + export GOPATH + export PATH="${GOPATH}/bin:${PATH}" + INSTALL_IN_GOPATH=true "${repo_root_dir}/ci/install_yq.sh" +} +function run_tests() { platform="${1}" + 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" diff --git a/tests/integration/kubernetes/setup.sh b/tests/integration/kubernetes/setup.sh index 639826bc8..6984ad286 100755 --- a/tests/integration/kubernetes/setup.sh +++ b/tests/integration/kubernetes/setup.sh @@ -29,7 +29,6 @@ set_initrd_path() { } main() { - INSTALL_IN_GOPATH=false bash "${repo_root_dir}/ci/install_yq.sh" set_runtime_class set_kernel_path set_initrd_path