Skip to content

Commit

Permalink
Merge pull request #1 from flecoufle/fix-secret-postgresql
Browse files Browse the repository at this point in the history
Fix Release.Name in job-upgrade-db
  • Loading branch information
flecoufle authored Mar 21, 2023
2 parents 4e41025 + 491f4d6 commit 44a5fc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helm/flowforge/templates/job-upgrade-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
upgrade.sh: |
#!/bin/sh
apk add --no-cache postgresql14-client
psql -v ON_ERROR_STOP=1 -h flowforge-postgresql -U postgres postgres <<-ESQL
psql -v ON_ERROR_STOP=1 -h {{ .Release.Name }}-postgresql -U postgres postgres <<-ESQL
SELECT datname FROM pg_database WHERE datistemplate = false;
SELECT 'CREATE DATABASE "ff-context"' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'ff-context')\gexec
GRANT ALL PRIVILEGES ON DATABASE "ff-context" TO "forge";
Expand All @@ -16,7 +16,7 @@ data:
apiVersion: batch/v1
kind: Job
metadata:
name: flowforge-db-upgrade
name: {{ .Release.Name }}-db-upgrade
labels:
annotations:
"helm.sh/hook": post-upgrade,post-install
Expand All @@ -37,7 +37,7 @@ spec:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: flowforge-postgresql
name: {{ .Release.Name }}-postgresql
key: postgresql-postgres-password
volumeMounts:
- name: upgrade-script
Expand Down

0 comments on commit 44a5fc9

Please sign in to comment.