diff --git a/test/nextcloud/2.3.2/templates/deployment.yaml b/test/nextcloud/2.3.2/templates/deployment.yaml index e0f1dde442b..10ee90fcd99 100644 --- a/test/nextcloud/2.3.2/templates/deployment.yaml +++ b/test/nextcloud/2.3.2/templates/deployment.yaml @@ -49,19 +49,19 @@ spec: {{- else }} {{- if eq .Values.externalDatabase.type "postgresql" }} - name: POSTGRES_HOST - value: {{ .Values.externalDatabase.host | quote }} + value: {{ template "nextcloud.fullname" . }}-postgres:5432 - name: POSTGRES_DB - value: {{ .Values.externalDatabase.database | quote }} + value: "nextcloud" - name: POSTGRES_USER valueFrom: secretKeyRef: - name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }} - key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }} + name: db-details + key: db-user - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: - name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }} - key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }} + name: db-details + key: db-password {{- end }} {{- end }} - name: NEXTCLOUD_ADMIN_USER diff --git a/test/nextcloud/2.3.2/templates/postgres-deployment.yaml b/test/nextcloud/2.3.2/templates/postgres-deployment.yaml index ecc6e56a934..2214fc340b5 100644 --- a/test/nextcloud/2.3.2/templates/postgres-deployment.yaml +++ b/test/nextcloud/2.3.2/templates/postgres-deployment.yaml @@ -28,6 +28,11 @@ spec: image: "postgres:13.1" imagePullPolicy: {{ .Values.image.pullPolicy }} env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: db-details + key: db-user - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: diff --git a/test/nextcloud/2.3.2/templates/postgres-secret.yaml b/test/nextcloud/2.3.2/templates/postgres-secret.yaml index c19e626e65b..c6b3743dcac 100644 --- a/test/nextcloud/2.3.2/templates/postgres-secret.yaml +++ b/test/nextcloud/2.3.2/templates/postgres-secret.yaml @@ -9,4 +9,5 @@ data: # `index` function is necessary because the property name contains a dash. # Otherwise (...).data.db_password would have worked too. db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }} + db-user: postgres {{ end }}