Skip to content

Commit

Permalink
fix-envs-in-charts-templates
Browse files Browse the repository at this point in the history
  • Loading branch information
MargoTuleninova committed Oct 15, 2018
1 parent fb61d50 commit 603fb4f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
42 changes: 21 additions & 21 deletions charts/user-manager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,49 @@ spec:
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
{{- if .Values.env.local.CH_USER_PG_ADDR }}
- name: CH_USER_PG_ADDR
value: "{{ .Values.env.local.CH_USER_PG_ADDR }}"
{{- if .Values.env.local.PG_ADDR }}
- name: PG_ADDR
value: "{{ .Values.env.local.PG_ADDR }}"
{{- else }}
- name: CH_USER_PG_ADDR
- name: PG_ADDR
value: "{{ .Release.Name }}-postgresql:5432"
{{- end }}
{{- if .Values.env.local.CH_USER_PERMISSIONS_URL }}
- name: CH_USER_PERMISSIONS_URL
value: "{{ .Values.env.local.CH_USER_PERMISSIONS_URL }}"
{{- if .Values.env.local.PERMISSIONS_URL }}
- name: PERMISSIONS_URL
value: "{{ .Values.env.local.PERMISSIONS_URL }}"
{{- else }}
- name: CH_USER_PERMISSIONS_URL
- name: PERMISSIONS_URL
value: "http://{{ .Release.Name }}-permissions:4242"
{{- end }}
{{- if .Values.env.local.CH_USER_AUTH_HTTP_ADDR }}
- name: CH_USER_AUTH_HTTP_ADDR
value: "{{ .Values.env.local.CH_USER_AUTH_HTTP_ADDR }}"
{{- if .Values.env.local.AUTH_URL }}
- name: AUTH_URL
value: "{{ .Values.env.local.AUTH_URL }}"
{{- else }}
- name: CH_USER_AUTH_HTTP_ADDR
- name: AUTH_URL
value: "http://{{ .Release.Name }}-auth:1111"
{{- end }}
{{- if .Values.env.local.CH_USER_MAIL_URL }}
- name: CH_USER_MAIL_URL
value: "{{ .Values.env.local.CH_USER_MAIL_URL }}"
{{- if .Values.env.local.MAIL_URL }}
- name: MAIL_URL
value: "{{ .Values.env.local.MAIL_URL }}"
{{- else }}
- name: CH_USER_MAIL_URL
- name: MAIL_URL
value: "http://{{ .Release.Name }}-mail:7070"
{{- end }}
{{- if .Values.env.local.CH_USER_PG_PASSWORD }}
- name: CH_USER_PG_PASSWORD
{{- if .Values.env.local.PG_PASSWORD }}
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: pg-password
{{- else if .Values.tags.platformdb }}
- name: CH_USER_PG_PASSWORD
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgresql
key: postgres-password
{{- end }}
{{- if .Values.env.local.CH_USER_ADMIN_PASSWORD }}
- name: CH_USER_ADMIN_PASSWORD
{{- if .Values.env.local.ADMIN_PASSWORD }}
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
Expand Down
10 changes: 5 additions & 5 deletions charts/user-manager/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if or .Values.env.local.CH_USER_PG_PASSWORD .Values.env.local.CH_USER_ADMIN_PASSWORD }}
{{- if or .Values.env.local.PG_PASSWORD .Values.env.local.ADMIN_PASSWORD }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -10,10 +10,10 @@ metadata:
heritage: {{ .Release.Service }}
type: Opaque
data:
{{- if .Values.env.local.CH_USER_PG_PASSWORD }}
pg-password: {{ .Values.env.local.CH_USER_PG_PASSWORD | b64enc }}
{{- if .Values.env.local.PG_PASSWORD }}
pg-password: {{ .Values.env.local.PG_PASSWORD | b64enc }}
{{- end }}
{{- if .Values.env.local.CH_USER_ADMIN_PASSWORD }}
admin-password: {{ .Values.env.local.CH_USER_ADMIN_PASSWORD | b64enc }}
{{- if .Values.env.local.ADMIN_PASSWORD }}
admin-password: {{ .Values.env.local.ADMIN_PASSWORD | b64enc }}
{{- end }}
{{- end }}

0 comments on commit 603fb4f

Please sign in to comment.