Merge pull request #101800 from dims/add-a-retry-for-apk-operations

[agnhost] Add a retry for apk operations
This commit is contained in:
Kubernetes Prow Robot 2021-05-07 13:32:10 -07:00 committed by GitHub
commit c224ca7674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,8 @@ CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/
# - iproute2: includes ss used in NodePort tests
# from iperf image
# install necessary packages: iperf, bash
RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \
RUN retry () { i=0; while [ $i -lt 9 ]; do "$@" && return || sleep 30; i="${i+1}"; done; "$@"; } \
&& retry apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \
&& ln -s /usr/bin/iperf /usr/local/bin/iperf \
&& ls -altrh /usr/local/bin/iperf