From 1b9ae7523357cac253bcc8f6f3d6b3eeca5aa672 Mon Sep 17 00:00:00 2001 From: Sebastian Sch Date: Wed, 1 Jan 2025 13:34:33 +0200 Subject: [PATCH] CI fix: switch flannel images from docker to quay.io This is to handle the rate limit of docker Signed-off-by: Sebastian Sch --- hack/run-e2e-conformance-virtual-cluster.sh | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/hack/run-e2e-conformance-virtual-cluster.sh b/hack/run-e2e-conformance-virtual-cluster.sh index d6fa44fd9..de7ec8d1e 100755 --- a/hack/run-e2e-conformance-virtual-cluster.sh +++ b/hack/run-e2e-conformance-virtual-cluster.sh @@ -105,6 +105,43 @@ kcli create cluster generic --paramfile ./${cluster_name}-plan.yaml $cluster_nam export KUBECONFIG=$HOME/.kcli/clusters/$cluster_name/auth/kubeconfig export PATH=$PWD:$PATH +# w/a switch flannel images to use quay repo to avoid dockerhub pull limit +# [SchSeba] there is a cronjob in place to make a copy of the image between dockerhub and quay account +ds=`kubectl -n kube-flannel get daemonset kube-flannel-ds -oyaml` +tag=$(echo $ds | grep -oP "docker.io/flannel/flannel-cni-plugin:\K[^\" ]+") +tag=$(echo $tag | cut -d' ' -f1) + +tag1=$(echo $ds | grep -oP "docker.io/flannel/flannel:\K[^\" ]+") +tag1=$(echo $tag1 | cut -d' ' -f1) + +patch="{ + \"spec\": { + \"template\": { + \"spec\": { + \"containers\": [ + { + \"name\": \"kube-flannel\", + \"image\": \"quay.io/schseba/flannel:$tag1\" + } + ], + \"initContainers\": [ + { + \"name\": \"install-cni-plugin\", + \"image\": \"quay.io/schseba/flannel-cni-plugin:$tag\" + }, + { + \"name\": \"install-cni\", + \"image\": \"quay.io/schseba/flannel:$tag1\" + } + ] + } + } + } +}" + +kubectl patch daemonset kube-flannel-ds -n kube-flannel --type='strategic' -p "$patch" +# ---------------------------------------------------------------------------------------- + ATTEMPTS=0 MAX_ATTEMPTS=72 ready=false