From fb5e259db465792f656aed8ff241fbff177f54c5 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Thu, 25 Jul 2024 22:17:58 +0000 Subject: [PATCH] add timeout to infinite loop in ci-entrypoint.sh --- scripts/ci-entrypoint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/ci-entrypoint.sh b/scripts/ci-entrypoint.sh index 4a2d4a6c712..fd7092853e3 100755 --- a/scripts/ci-entrypoint.sh +++ b/scripts/ci-entrypoint.sh @@ -162,6 +162,13 @@ copy_kubeadm_config_map() { fi } +wait_for_copy_kubeadm_config_map() { + echo "Copying kubeadm ConfigMap into calico-system namespace" + until copy_kubeadm_config_map; do + sleep 5 + done +} + # wait_for_nodes returns when all nodes in the workload cluster are Ready. wait_for_nodes() { echo "Waiting for ${CONTROL_PLANE_MACHINE_COUNT} control plane machine(s), ${WORKER_MACHINE_COUNT} worker machine(s), and ${WINDOWS_WORKER_MACHINE_COUNT:-0} windows machine(s) to become Ready" @@ -199,9 +206,8 @@ wait_for_pods() { } install_addons() { - until copy_kubeadm_config_map; do - sleep 5 - done + export -f copy_kubeadm_config_map wait_for_copy_kubeadm_config_map + timeout --foreground 600 bash -c wait_for_copy_kubeadm_config_map # In order to determine the successful outcome of CNI and cloud-provider-azure, # we need to wait a little bit for nodes and pods terminal state, # so we block successful return upon the cluster being fully operational.