From d0ef78d3a428ce984ed69bfb28c7b95571daac61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 18 Feb 2025 11:39:22 +0100 Subject: [PATCH] ci: Change the way we modify runtimeclass in webhook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit previously we used to deploy the webhook and then modified the cm from our ci/openshift-ci/ script to the desired value, but sometimes it happens that the webhook pod starts before we modify the cm and keeps using the default value. Let's change the approach and modify the deployments in-place. The only cons is it leaves the git dirty, but since this script is only supposed to be used in ci it should be safe. Signed-off-by: Lukáš Doktor --- ci/openshift-ci/cluster/deploy_webhook.sh | 7 ++----- .../deployments/configmap_kata-webhook.yaml.in | 12 ------------ 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 ci/openshift-ci/cluster/deployments/configmap_kata-webhook.yaml.in diff --git a/ci/openshift-ci/cluster/deploy_webhook.sh b/ci/openshift-ci/cluster/deploy_webhook.sh index c0ea9e3d7d..0b732da695 100755 --- a/ci/openshift-ci/cluster/deploy_webhook.sh +++ b/ci/openshift-ci/cluster/deploy_webhook.sh @@ -23,14 +23,11 @@ pushd "${webhook_dir}" >/dev/null # info "Builds the kata-webhook" ./create-certs.sh +info "Override our KATA_RUNTIME ConfigMap" +sed -i deploy/webhook.yaml -e "s/runtime_class: .*$/runtime_class: $KATA_RUNTIME/g" 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 diff --git a/ci/openshift-ci/cluster/deployments/configmap_kata-webhook.yaml.in b/ci/openshift-ci/cluster/deployments/configmap_kata-webhook.yaml.in deleted file mode 100644 index 4c587cbe04..0000000000 --- a/ci/openshift-ci/cluster/deployments/configmap_kata-webhook.yaml.in +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2021 Red Hat, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# -# Apply customizations to the kata-webhook. -# -apiVersion: v1 -kind: ConfigMap -metadata: - name: kata-webhook -data: - runtime_class: ${RUNTIME_CLASS}