From 8355eee9f57c0b53a75971bfac36526722842bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 24 Sep 2024 17:01:18 +0200 Subject: [PATCH] ci: Reorder webhook deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in b9d88f74edc463dc14ef52135c592fbb6bd5c792 the `runtime_class` CM was added which overrides the one we previously set. Let's reorder our logic to first deploy webhook and then override the default CM in order to use the one we really want. Since we need to change dirs we also have to use realpath to ensure the files are located well. Signed-off-by: Lukáš Doktor --- ci/openshift-ci/cluster/deploy_webhook.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/openshift-ci/cluster/deploy_webhook.sh b/ci/openshift-ci/cluster/deploy_webhook.sh index 40a8f55e36..c0ea9e3d7d 100755 --- a/ci/openshift-ci/cluster/deploy_webhook.sh +++ b/ci/openshift-ci/cluster/deploy_webhook.sh @@ -13,16 +13,11 @@ set -e set -o nounset set -o pipefail -script_dir="$(dirname $0)" +script_dir="$(realpath $(dirname $0))" webhook_dir="${script_dir}/../../../tools/testing/kata-webhook" source "${script_dir}/../lib.sh" KATA_RUNTIME=${KATA_RUNTIME:-kata-ci} -info "Creates the kata-webhook ConfigMap" -RUNTIME_CLASS="${KATA_RUNTIME}" \ - envsubst < "${script_dir}/deployments/configmap_kata-webhook.yaml.in" \ - | oc apply -f - - pushd "${webhook_dir}" >/dev/null # Build and deploy the webhook # @@ -30,6 +25,12 @@ info "Builds the kata-webhook" ./create-certs.sh info "Deploys the kata-webhook" oc apply -f deploy/ + +info "Override our KATA_RUNTIME ConfigMap" +RUNTIME_CLASS="${KATA_RUNTIME}" \ + envsubst < "${script_dir}/deployments/configmap_kata-webhook.yaml.in" \ + | oc apply -f - + # Check the webhook was deployed and is working. RUNTIME_CLASS="${KATA_RUNTIME}" ./webhook-check.sh popd >/dev/null