From 954ac97d229716f8d588df864dc171db291f556d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 24 Nov 2020 17:08:32 +0100 Subject: [PATCH] ci: add more logging during Rook deployment It seems that the new log_errors() function does not get triggered when the script hits `exit 1` conditions in functions. The functions should return a non-0 value, not cause an exit of the script. Signed-off-by: Niels de Vos --- scripts/rook.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/rook.sh b/scripts/rook.sh index 7ee117002..cd47a98c7 100755 --- a/scripts/rook.sh +++ b/scripts/rook.sh @@ -59,6 +59,12 @@ kubectl_retry() { ret=1 break fi + + # log stderr and empty the tmpfile + cat "${stderr}" > /dev/stderr + true > "${stderr}" + echo "kubectl_retry ${*} failed, will retry in ${KUBECTL_RETRY_DELAY} seconds" + sleep ${KUBECTL_RETRY_DELAY} done @@ -160,7 +166,7 @@ function check_ceph_cluster_health() { if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then echo "[Timeout] CEPH cluster not in a healthy state (timeout)" - exit 1 + return 1 fi echo "" } @@ -186,7 +192,7 @@ function check_mds_stat() { if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then echo "[Timeout] Failed to get ceph filesystem pods" - exit 1 + return 1 fi echo "" } @@ -213,7 +219,7 @@ function check_rbd_stat() { if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then echo "[Timeout] Failed to get RBD pool stats" - exit 1 + return 1 fi echo "" }