From 3a87df91a05c36c32a11094b09890169ede2ccea Mon Sep 17 00:00:00 2001 From: Matt Pryor Date: Mon, 19 Jun 2023 16:55:45 +0100 Subject: [PATCH] Make sure that retrieve script actually iterates --- scripts/sonobuoy-retrieve.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/sonobuoy-retrieve.sh b/scripts/sonobuoy-retrieve.sh index e75d3d8..f5d98a1 100755 --- a/scripts/sonobuoy-retrieve.sh +++ b/scripts/sonobuoy-retrieve.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x ##### # This script wraps sonobuoy retrieve with a retry @@ -11,12 +11,8 @@ set -e retries=0 retry_limit=20 -while true; do - result_file=$(sonobuoy retrieve "$@") - RC=$? - if [[ ${RC} -eq 0 ]]; then - break - fi + +until sonobuoy retrieve "$@"; do retries=$(( retries + 1 )) if [[ ${retries} -eq ${retry_limit} ]]; then echo "Retries timed out. Check 'sonobuoy retrieve' command."