Skip to content

Commit ce40f31

Browse files
committed
e2e: fix debian_injection_script for kubernetes v1.35 which removed kubelet's pod-infra-container-image flag
1 parent 4b1dd04 commit ce40f31

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ if [[ "$${KUBERNETES_VERSION}" != "" ]]; then
116116
$${SUDO} ctr -n k8s.io images tag "$${IMAGE_REGISTRY_PREFIX}/$${CI_CONTAINER}-amd64:$${KUBERNETES_VERSION//+/_}" "$${IMAGE_REGISTRY_PREFIX}/$${CI_CONTAINER}:$${KUBERNETES_VERSION//+/_}"
117117
$${SUDO} ctr -n k8s.io images tag "$${IMAGE_REGISTRY_PREFIX}/$${CI_CONTAINER}-amd64:$${KUBERNETES_VERSION//+/_}" "gcr.io/k8s-staging-ci-images/$${CI_CONTAINER}:$${KUBERNETES_VERSION//+/_}"
118118
done
119+
120+
# TODO: remove once we use k8s v1.35 image-builder templates.
121+
# Note: This is a temporary fix to ensure the flag --pod-infra-container-image is not set which was removed in k8s v1.35 and deprecated for a long time.
122+
echo "Clearing --pod-infra-container-image in /etc/sysconfig/kubelet and/or /etc/default/kubelet if they exist"
123+
sed -i -E 's/--pod-infra-container-image[= ][a-zA-Z0-9._/-]+(:[a-zA-Z0-9._-]+ +)?//' /etc/sysconfig/kubelet || true
124+
sed -i -E 's/--pod-infra-container-image[= ][a-zA-Z0-9._/-]+(:[a-zA-Z0-9._-]+ +)?//' /etc/default/kubelet || true
119125
fi
120126
echo "* checking binary versions"
121127
echo "ctr version: " "$(ctr version)"

0 commit comments

Comments
 (0)