From 21a350718f5e84a580bc677213bc25faec3291e7 Mon Sep 17 00:00:00 2001 From: Lennart Jern Date: Thu, 12 Jan 2023 09:09:40 +0200 Subject: [PATCH] E2e: Unhold CI packages before installing It is common to mark kubeadm and related packages as held at a specific version to avoid accidental upgrades. The script for injecting CI artifacts does not take this into account, which means that if the base image used already has some version of a package installed and held, the script will fail to install the asked for version. To avoid this, we unhold before installing the packages and then hold again, as customary. Holding after installation also avoids any unintended upgrades later. --- .../data/debian_injection_script.envsubst.sh.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/framework/kubernetesversions/data/debian_injection_script.envsubst.sh.tpl b/test/framework/kubernetesversions/data/debian_injection_script.envsubst.sh.tpl index 7b5e66b21236..593ff3e323ce 100644 --- a/test/framework/kubernetesversions/data/debian_injection_script.envsubst.sh.tpl +++ b/test/framework/kubernetesversions/data/debian_injection_script.envsubst.sh.tpl @@ -88,7 +88,9 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then PACKAGE_VERSION="$(apt-cache madison kubelet | grep "$${VERSION_REGEX}-" | head -n1 | cut -d '|' -f 2 | tr -d '[:space:]')" for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* installing package: $${CI_PACKAGE} $${PACKAGE_VERSION}" + apt-mark unhold "$${CI_PACKAGE}" apt-get install -y "$${CI_PACKAGE}=$${PACKAGE_VERSION}" + apt-mark hold "$${CI_PACKAGE}" done else CI_URL="https://dl.k8s.io/ci/$${KUBERNETES_VERSION}/bin/linux/amd64"