From 6e7d0987c33fd9a8e92ee63cc733162b7d200cad Mon Sep 17 00:00:00 2001 From: Valentin Afanasev Date: Tue, 5 Aug 2025 03:25:33 +0300 Subject: [PATCH] wait for pod --- .gitea/actions/create/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/actions/create/action.yml b/.gitea/actions/create/action.yml index d62d810..b46346e 100644 --- a/.gitea/actions/create/action.yml +++ b/.gitea/actions/create/action.yml @@ -8,6 +8,14 @@ runs: steps: - run: | curl -s https://gitea.vecus.ru/ci/postgres-actions/raw/branch/master/.gitea/actions/create/postgres-template.yaml | envsubst | werf kubectl apply -f - + echo "Waiting for pod to be ready..." + timeout=60 + while ! werf kubectl get pod ${POD_NAME} -o jsonpath='{.status.containerStatuses[0].ready}' 2>/dev/null | grep -q true; do + echo "Still not ready..." + sleep 2 + timeout=$((timeout - 2)) + [ $timeout -le 0 ] && echo "Timeout waiting for pod" && exit 1 + done shell: bash env: POD_NAME: ${{ inputs.service_name }}