Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _helpers.tpl env vars that use secret keys #572

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ Create environment variables used to configure the nextcloud container as well a
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
{{- else if .Values.postgresql.enabled }}
- name: POSTGRES_HOST
value: {{ template "postgresql.v1.primary.fullname" .Subcharts.postgresql }}
Expand All @@ -100,12 +100,12 @@ Create environment variables used to configure the nextcloud container as well a
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
{{- else }}
{{- if eq .Values.externalDatabase.type "postgresql" }}
- name: POSTGRES_HOST
Expand All @@ -130,12 +130,12 @@ Create environment variables used to configure the nextcloud container as well a
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
{{- else }}
- name: MYSQL_HOST
{{- if .Values.externalDatabase.existingSecret.hostKey }}
Expand All @@ -159,24 +159,24 @@ Create environment variables used to configure the nextcloud container as well a
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey }}
key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-db" .Release.Name) }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey }}
key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
{{- end }}
{{- end }}
- name: NEXTCLOUD_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.usernameKey }}
key: {{ .Values.nextcloud.existingSecret.usernameKey | default "nextcloud-username" }}
- name: NEXTCLOUD_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.passwordKey }}
key: {{ .Values.nextcloud.existingSecret.passwordKey | default "nextcloud-password" }}
- name: NEXTCLOUD_TRUSTED_DOMAINS
value: {{ .Values.nextcloud.host }}{{ if .Values.metrics.enabled }} {{ template "nextcloud.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local{{ end }}
{{- if ne (int .Values.nextcloud.update) 0 }}
Expand Down Expand Up @@ -205,12 +205,12 @@ Create environment variables used to configure the nextcloud container as well a
valueFrom:
secretKeyRef:
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.smtpUsernameKey }}
key: {{ .Values.nextcloud.existingSecret.smtpUsernameKey | default "smtp-username" }}
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.smtpPasswordKey }}
key: {{ .Values.nextcloud.existingSecret.smtpPasswordKey | default "smtp-password" }}
{{- end }}
{{- if .Values.redis.enabled }}
- name: REDIS_HOST
Expand Down
Loading