From fdaa44da731f7cbee95f35ba1cae2e5c0c1a7f33 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 7 May 2021 12:44:37 -0400 Subject: [PATCH] [agnhost] Add a retry for apk operations Signed-off-by: Davanum Srinivas --- test/images/agnhost/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/images/agnhost/Dockerfile b/test/images/agnhost/Dockerfile index 3cfe56c9cb2..65c783d6490 100644 --- a/test/images/agnhost/Dockerfile +++ b/test/images/agnhost/Dockerfile @@ -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