diff --git a/charts/strapi/Chart.yaml b/charts/strapi/Chart.yaml index a0be03d..faa1af9 100644 --- a/charts/strapi/Chart.yaml +++ b/charts/strapi/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.5 +version: 0.2.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/strapi/templates/_helpers.tpl b/charts/strapi/templates/_helpers.tpl index 1ddd0cc..707f484 100644 --- a/charts/strapi/templates/_helpers.tpl +++ b/charts/strapi/templates/_helpers.tpl @@ -30,6 +30,17 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +# just the internal database host name, used as backup target +{{- define "strapi.internalDatabaseBackupHost" -}} +{{- if eq .Values.postgresql.architecture "replication" }} +{{- printf "%s%s" .Release.Name "-postgresql-primary" }} +{{- else }} +{{- printf "%s%s" .Release.Name "-postgresql" }} +{{- end }} +{{- end }} + + + {{- define "strapi.internalDatabaseUrl" -}} {{- if eq .Values.postgresql.architecture "replication" }} {{- printf "%s%s%s%s%s%s%s%s" "postgresql://" .Values.postgresql.auth.username ":" .Values.postgresql.auth.password "@" .Release.Name "-postgresql-primary:5432/" .Values.postgresql.auth.database }} diff --git a/charts/strapi/templates/postgres_backup.yaml b/charts/strapi/templates/postgres_backup.yaml index 1538f93..b33b3cb 100644 --- a/charts/strapi/templates/postgres_backup.yaml +++ b/charts/strapi/templates/postgres_backup.yaml @@ -74,7 +74,7 @@ spec: key: POSTGRES_DB_USER name: {{ include "strapi.fullname" . }} - name: POSTGRES_DB_HOST - value: "{{ $fullName }}-postgresql" + value: {{ include "strapi.internalDatabaseBackupHost" .}} - name: POSTGRES_DB_PORT value: "5432" envFrom: