Skip to content

Commit 63c4ecb

Browse files
Add PostgreSQL readiness check in create-cluster
1 parent ca0d53f commit 63c4ecb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testing/chainsaw/e2e/pgbackrest-restore/templates/create-cluster.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ spec:
8181
postgres-operator.crunchydata.com/role=master'
8282
)
8383
84+
# Wait for PostgreSQL to be ready
85+
until kubectl exec --namespace "${NAMESPACE}" "${PRIMARY}" \
86+
-- psql -qAt --command 'SELECT 1' 2>/dev/null; do
87+
sleep 1
88+
done
89+
8490
kubectl exec --stdin --namespace "${NAMESPACE}" "${PRIMARY}" -- psql -q --file=- <<'SQL'
8591
CREATE TABLESPACE barn LOCATION '/tablespaces/barn/data';
8692
GRANT ALL ON TABLESPACE barn TO public;

0 commit comments

Comments
 (0)