Verified Commit de9e28c6 authored by Hugo's avatar Hugo
Browse files

add name helpers

parent a0539aee
{{- define "configName" -}}
{{ tpl .Values.fqdn . }}-config
{{- end -}}
{{- define "secretName" -}}
{{ tpl .Values.fqdn . }}-app
{{- end -}}
\ No newline at end of file
kind: ConfigMap
metadata:
name: {{ tpl .Values.fqdn . }}-config
name: {{ template "configName" . }}
apiVersion: v1
data:
{{- if .Values.oauth.enabled }}
......
......@@ -26,16 +26,6 @@ spec:
volumes:
containers:
- env:
- name: CMD_DB_URL
valueFrom:
secretKeyRef:
key: postgresql-url
name: {{ tpl .Values.fqdn . }}
- name: CMD_SESSION_SECRET
valueFrom:
secretKeyRef:
key: session
name: {{ tpl .Values.fqdn . }}
- name: CMD_MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
......@@ -60,7 +50,9 @@ spec:
{{- end }}
envFrom:
- configMapRef:
name: {{ tpl .Values.fqdn . }}-config
name: {{ template "configName" . }}
- secretRef:
name: {{ template "secretName" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
name: hedgedoc
......
{{ $secretName := print (tpl .Values.fqdn .) "-app" }}
{{ $secret := lookup "v1" "Secret" .Release.Namespace $secretName }}
{{ $secret := lookup "v1" "Secret" .Release.Namespace (include "secretName" .) }}
{{ $pgSecretName := print "hedgedoc.pg-" .Release.Namespace .Values.pgCredentialsSuffix }}
{{ $pgSecret := lookup "v1" "Secret" .Release.Namespace $pgSecretName }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
name: {{ template "secretName" . }}
type: Opaque
stringData:
{{- if $pgSecret.data }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment