fix: retry transient registry pulls
This commit is contained in:
@@ -6,13 +6,17 @@
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if timeout 180s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
|
||||
echo "mtu=$(cat /sys/class/net/{{ ansible_default_ipv4.interface | default('eth0') }}/mtu 2>/dev/null || true)"
|
||||
ip route get 1.1.1.1 || true
|
||||
|
||||
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
||||
echo "pull attempt ${attempt}: {{ item }}"
|
||||
if timeout 240s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
|
||||
echo "pulled image"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sleep 10
|
||||
sleep 15
|
||||
done
|
||||
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user