Skip to content

Commit

Permalink
Merge pull request #2481 from bcgov/chore/conditional-superuser-envs
Browse files Browse the repository at this point in the history
chore: conditionally add superuser envs
  • Loading branch information
dleard authored Nov 18, 2024
2 parents 244a6ac + 1d20f60 commit 47927a5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 20 deletions.
10 changes: 0 additions & 10 deletions helm/cas-bciers/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,6 @@ Define environment variables for the application.
value: '*'
- name: BACKEND_HOST
value: {{ .Values.backend.route.host }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
- name: GS_BUCKET_NAME
valueFrom:
secretKeyRef:
Expand Down
22 changes: 22 additions & 0 deletions helm/cas-bciers/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ spec:
- "create_superuser"
env:
{{- include "cas-bciers.backendEnvVars" . | nindent 12 }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
volumeMounts:
- mountPath: "/attachment-credentials"
name: gcs-attachment-credentials
Expand All @@ -45,6 +55,18 @@ spec:
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
env:
{{- include "cas-bciers.backendEnvVars" . | nindent 12 }}
{{- if hasSuffix "-dev" .Release.Namespace }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
{{- end }}
{{- if hasSuffix "-prod" .Release.Namespace }}
- name: SENTRY_ENVIRONMENT
value: {{ include "cas-bciers.namespaceSuffix" . }}
Expand Down
10 changes: 0 additions & 10 deletions helm/cas-registration/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ Define environment variables for the application.
value: '*'
- name: BACKEND_HOST
value: {{ .Values.backend.route.host }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
- name: GS_BUCKET_NAME
valueFrom:
secretKeyRef:
Expand Down
22 changes: 22 additions & 0 deletions helm/cas-registration/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ spec:
- "create_superuser"
env:
{{- include "cas-registration.backendEnvVars" . | nindent 12 }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
volumeMounts:
- mountPath: "/attachment-credentials"
name: gcs-attachment-credentials
Expand All @@ -45,6 +55,18 @@ spec:
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
env:
{{- include "cas-registration.backendEnvVars" . | nindent 12 }}
{{- if hasSuffix "-dev" .Release.Namespace }}
- name: DJANGO_SUPERUSER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: django-superuser
- name: DJANGO_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: django-superuser
{{- end }}
{{- if hasSuffix "-prod" .Release.Namespace }}
- name: SENTRY_ENVIRONMENT
value: {{ include "cas-registration.namespaceSuffix" . }}
Expand Down

0 comments on commit 47927a5

Please sign in to comment.