From 4c7256e5c96d18e4f187074354690a11d65b57fe Mon Sep 17 00:00:00 2001 From: Kurocon Date: Fri, 6 Sep 2024 12:10:50 +0000 Subject: [PATCH] Make environment of migrate job identical to the regular web container deployment, as it should be. --- templates/migrate-job.yaml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/templates/migrate-job.yaml b/templates/migrate-job.yaml index f86a918..07718ae 100644 --- a/templates/migrate-job.yaml +++ b/templates/migrate-job.yaml @@ -39,12 +39,6 @@ spec: {{- end }} command: {{ .Values.migrationJob.command | default (list "./manage.py" "migrate") | toJson }} env: - - name: DEBUG - value: "False" -{{- if .Values.env.secret.DATABASE_URL }} - - name: DATABASE_URL - value: {{ .Values.env.secret.DATABASE_URL }} -{{- end }} {{- if .Values.postgresql.enabled }} - name: DATABASE_PASSWORD valueFrom: @@ -52,13 +46,13 @@ spec: name: {{ default (include "django.postgresql.fullname" .) .Values.postgresql.auth.existingSecret }} key: postgres-password {{- end }} - - name: SECRET_KEY - value: {{ required "env.secret.SECRET_KEY is a required value." .Values.env.secret.SECRET_KEY }} - {{- range $k, $v := .Values.env.normal }} - - name: {{ $k }} - value: {{ $v | quote }} - {{- end }} envFrom: + - secretRef: + name: {{ include "django.fullname" . }} + {{- if .Values.existingSecret }} + - secretRef: + name: {{ .Values.existingSecret }} + {{- end }} - configMapRef: name: {{ include "django.fullname" . }} {{- with .Values.extraVolumeMounts }}