Add printing failed message when timeout

Signed-off-by: sophal <sophalHong@github.com>
This commit is contained in:
sophal 2020-02-07 09:43:37 +09:00 committed by mergify[bot]
parent 419ad0dd8e
commit 1695c6965d

View File

@ -51,6 +51,11 @@ function check_ceph_cluster_health() {
fi fi
fi fi
done done
if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then
echo "[Timeout] CEPH cluster not in a healthy state (timeout)"
exit 1
fi
echo "" echo ""
} }
@ -72,6 +77,11 @@ function check_mds_stat() {
fi fi
fi fi
done done
if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then
echo "[Timeout] Failed to get ceph filesystem pods"
exit 1
fi
echo "" echo ""
} }
@ -82,14 +92,19 @@ function check_rbd_stat() {
TOOLBOX_POD=$(kubectl -n rook-ceph get pods -l app=rook-ceph-tools -o jsonpath='{.items[0].metadata.name}') TOOLBOX_POD=$(kubectl -n rook-ceph get pods -l app=rook-ceph-tools -o jsonpath='{.items[0].metadata.name}')
TOOLBOX_POD_STATUS=$(kubectl -n rook-ceph get pod "$TOOLBOX_POD" -ojsonpath='{.status.phase}') TOOLBOX_POD_STATUS=$(kubectl -n rook-ceph get pod "$TOOLBOX_POD" -ojsonpath='{.status.phase}')
echo "Toolbox POD ($TOOLBOX_POD) status: [$TOOLBOX_POD_STATUS]" [[ "$TOOLBOX_POD_STATUS" != "Running" ]] && \
[[ "$TOOLBOX_POD_STATUS" != "Running" ]] && continue { echo "Toolbox POD ($TOOLBOX_POD) status: [$TOOLBOX_POD_STATUS]"; continue; }
if kubectl exec -n rook-ceph "$TOOLBOX_POD" -it -- rbd pool stats "$RBD_POOL_NAME" &>/dev/null; then if kubectl exec -n rook-ceph "$TOOLBOX_POD" -it -- rbd pool stats "$RBD_POOL_NAME" &>/dev/null; then
echo "RBD ($RBD_POOL_NAME) is successfully created..." echo "RBD ($RBD_POOL_NAME) is successfully created..."
break break
fi fi
done done
if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then
echo "[Timeout] Failed to get RBD pool stats"
exit 1
fi
echo "" echo ""
} }