Skip to content

Commit 4d548af

Browse files
Wait for postgres to be ready
1 parent 8b02f78 commit 4d548af

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testing/chainsaw/e2e/pgbackrest-restore/templates/change-parameters.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ spec:
2626
postgres-operator.crunchydata.com/cluster=original,
2727
postgres-operator.crunchydata.com/role=master
2828
29+
-
30+
description: >
31+
Wait for PostgreSQL to be ready
32+
script:
33+
skipCommandOutput: true
34+
timeout: 2m
35+
env:
36+
- name: PRIMARY
37+
value: ($primary)
38+
content: |
39+
until kubectl exec --namespace "${NAMESPACE}" "${PRIMARY}" \
40+
-- psql -qAt --command 'SELECT 1' 2>/dev/null; do
41+
sleep 1
42+
done
43+
2944
-
3045
description: >
3146
Read the timestamp at which PostgreSQL last started

0 commit comments

Comments
 (0)