Skip to content

Commit

Permalink
feat: Allow File Storage database name to be customised (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawlowski authored Feb 4, 2025
1 parent dee998b commit 536621c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ editors:
- `postgresql.auth.password` - the password to use to connect to the database (default `Zai1Wied`)
- `postgresql.auth.database` - the database to use (default `flowforge`)
- `postgresql.auth.postgresPassword` - the password to use for the postgres user (default `Moomiet0`)
- `postgresql.auth.fileStoreDatabase` - the database to use bt the File Storage servive (default `ff-context`)
- `postgresql.auth.existingSecret` - the name of an Kubernetes secret object with database credentials (If `postgresql.auth.existingSecret` is set, `postgresql.auth.password` and `postgresql.auth.postgresPassword` values are ignored; default not set)


Expand Down
6 changes: 3 additions & 3 deletions helm/flowforge/templates/file-storage-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data:
host: {{ include "forge.databaseHost" . }}
port: {{ .Values.postgresql.port | default 5432 }}
username: {{ .Values.postgresql.auth.username }}
database: ff-context
database: {{ .Values.postgresql.auth.fileStoreDatabase }}
password: <%= ENV['PGPASSWORD'] %>
{{- end }}
{{- if eq .Values.forge.fileStore.context.options.type "sqlite" }}
Expand Down Expand Up @@ -61,8 +61,8 @@ data:
# apk add --no-cache postgresql14-client
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";
SELECT 'CREATE DATABASE "{{ .Values.postgresql.auth.fileStoreDatabase }}"' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '{{ .Values.postgresql.auth.fileStoreDatabase }}')\gexec
GRANT ALL PRIVILEGES ON DATABASE "{{ .Values.postgresql.auth.fileStoreDatabase }}" TO "{{ .Values.postgresql.auth.username }}";
ESQL
{{- end }}
{{- end -}}
1 change: 1 addition & 0 deletions helm/flowforge/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ postgresql:
username: forge
password: Zai1Wied
database: flowforge
fileStoreDatabase: ff-context

ingress:
annotations: {}
Expand Down

0 comments on commit 536621c

Please sign in to comment.