We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85aea12 commit a2a1890Copy full SHA for a2a1890
.github/workflows/pr-close.yml
@@ -52,5 +52,15 @@ jobs:
52
53
PATCH_JSON=$(jq -n --argjson users "${UPDATED_USERS}" '{"spec": {"users": $users}}')
54
oc patch PostgresCluster/postgres-crunchy --type=merge -p "${PATCH_JSON}"
55
+
56
+ # get primary crunchy pod and remove the role and db
57
+ CRUNCHY_PG_PRIMARY_POD_NAME=$(oc get pods -l postgres-operator.crunchydata.com/role=master -o json | jq -r '.items[0].metadata.name')
58
59
+ echo "${CRUNCHY_PG_PRIMARY_POD_NAME}"
60
61
+ oc exec "${CRUNCHY_PG_PRIMARY_POD_NAME}" -- psql -c "DROP DATABASE \"app-${{ github.event.number }}\" --cascade"
62
+ oc exec "${CRUNCHY_PG_PRIMARY_POD_NAME}" -- psql -c "DROP ROLE \"app-${{ github.event.number }}\" --cascade"
63
+ echo 'database and role deleted'
64
65
exit 0
66
0 commit comments