Skip to content

Commit 21a3507

Browse files
committed
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.
1 parent b3665e0 commit 21a3507

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/framework/kubernetesversions/data/debian_injection_script.envsubst.sh.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then
8888
PACKAGE_VERSION="$(apt-cache madison kubelet | grep "$${VERSION_REGEX}-" | head -n1 | cut -d '|' -f 2 | tr -d '[:space:]')"
8989
for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do
9090
echo "* installing package: $${CI_PACKAGE} $${PACKAGE_VERSION}"
91+
apt-mark unhold "$${CI_PACKAGE}"
9192
apt-get install -y "$${CI_PACKAGE}=$${PACKAGE_VERSION}"
93+
apt-mark hold "$${CI_PACKAGE}"
9294
done
9395
else
9496
CI_URL="https://dl.k8s.io/ci/$${KUBERNETES_VERSION}/bin/linux/amd64"

0 commit comments

Comments
 (0)