Skip to content

Commit fb5e259

Browse files
committed
add timeout to infinite loop in ci-entrypoint.sh
1 parent 53fb683 commit fb5e259

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/ci-entrypoint.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ copy_kubeadm_config_map() {
162162
fi
163163
}
164164

165+
wait_for_copy_kubeadm_config_map() {
166+
echo "Copying kubeadm ConfigMap into calico-system namespace"
167+
until copy_kubeadm_config_map; do
168+
sleep 5
169+
done
170+
}
171+
165172
# wait_for_nodes returns when all nodes in the workload cluster are Ready.
166173
wait_for_nodes() {
167174
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() {
199206
}
200207

201208
install_addons() {
202-
until copy_kubeadm_config_map; do
203-
sleep 5
204-
done
209+
export -f copy_kubeadm_config_map wait_for_copy_kubeadm_config_map
210+
timeout --foreground 600 bash -c wait_for_copy_kubeadm_config_map
205211
# In order to determine the successful outcome of CNI and cloud-provider-azure,
206212
# we need to wait a little bit for nodes and pods terminal state,
207213
# so we block successful return upon the cluster being fully operational.

0 commit comments

Comments
 (0)