Skip to content

Commit 321eaba

Browse files
committed
fix: wait for pg_isready
1 parent 86a5e2c commit 321eaba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

k8s/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ kubectl config set-context --current --namespace=$KUBERNETES_NAMESPACE
5353
echo "Context set to namespace: \"$KUBERNETES_NAMESPACE\""
5454
kubectl apply --kustomize infrastructure/test
5555
__safe_migration_rollout test-postgres
56-
kubectl exec -i deployment/test-postgres -- sh -c "psql -U postgres -c '$(cat infrastructure/test/deployment/assets/init.sql)'" || true
56+
until kubectl exec -i deployment/test-postgres -- sh -c pg_isready; do
57+
echo "Waiting for postgres to be ready..."
58+
sleep 3
59+
done
60+
kubectl exec -i deployment/test-postgres -- sh -c "psql -U postgres -c '$(cat infrastructure/test/deployment/assets/init.sql)'"
5761
echo "::endgroup::"
5862

5963

0 commit comments

Comments
 (0)