diff --git a/templates/database/database-datafeeder-secret.yaml b/templates/database/database-datafeeder-secret.yaml index 2c9685d..7d9d737 100644 --- a/templates/database/database-datafeeder-secret.yaml +++ b/templates/database/database-datafeeder-secret.yaml @@ -8,9 +8,9 @@ metadata: {{- include "georchestra.labels" . | nindent 4 }} type: Opaque data: - dbname: {{ $database.auth.database | b64enc | quote }} - host: {{ $database.auth.host | b64enc | quote }} - password: {{ $database.auth.password | b64enc | quote }} - port: {{ $database.auth.port | b64enc | quote }} - user: {{ $database.auth.username | b64enc | quote }} + dbname: {{ required ".Values.datafeeder.auth.dbname is required." $database.auth.database | b64enc | quote }} + host: {{ required ".Values.datafeeder.auth.host is required." $database.auth.host | b64enc | quote }} + password: {{ required ".Values.datafeeder.auth.password is required." $database.auth.password | b64enc | quote }} + port: {{ required ".Values.datafeeder.auth.port is required." $database.auth.port | b64enc | quote }} + user: {{ required ".Values.datafeeder.auth.username is required." $database.auth.username | b64enc | quote }} {{- end }} diff --git a/templates/database/database-geodata-secret.yaml b/templates/database/database-geodata-secret.yaml index 2d7ae5d..6ac6b91 100644 --- a/templates/database/database-geodata-secret.yaml +++ b/templates/database/database-geodata-secret.yaml @@ -8,9 +8,9 @@ metadata: {{- include "georchestra.labels" . | nindent 4 }} type: Opaque data: - dbname: {{ $database.auth.database | b64enc | quote }} - host: {{ $database.auth.host | b64enc | quote }} - password: {{ $database.auth.password | b64enc | quote }} - port: {{ $database.auth.port | b64enc | quote }} - user: {{ $database.auth.username | b64enc | quote }} + dbname: {{ required ".Values.geodata.auth.dbname is required." $database.auth.database | b64enc | quote }} + host: {{ required ".Values.geodata.auth.host is required." $database.auth.host | b64enc | quote }} + password: {{ required ".Values.geodata.auth.password is required." $database.auth.password | b64enc | quote }} + port: {{ required ".Values.geodata.auth.port is required." $database.auth.port | b64enc | quote }} + user: {{ required ".Values.geodata.auth.username is required." $database.auth.username | b64enc | quote }} {{- end }} diff --git a/templates/database/database-georchestra-secret.yaml b/templates/database/database-georchestra-secret.yaml index 4c8738c..c04bd09 100644 --- a/templates/database/database-georchestra-secret.yaml +++ b/templates/database/database-georchestra-secret.yaml @@ -1,4 +1,3 @@ -{{- if and (.Values.database.geodata) (not .Values.database.geodata.auth.existingSecret ) }} {{- $database := .Values.database -}} {{- if not $database.auth.existingSecret -}} apiVersion: v1 @@ -9,14 +8,13 @@ metadata: {{- include "georchestra.labels" . | nindent 4 }} type: Opaque data: - dbname: {{ $database.auth.database | b64enc | quote }} + dbname: {{ required ".Values.database.auth.dbname is required." $database.auth.database | b64enc | quote }} {{- if $database.builtin }} host: {{ printf "%s-database" .Release.Name | b64enc | quote }} {{- else }} - host: {{ $database.auth.host | b64enc | quote }} + host: {{ required ".Values.database.auth.host is required." $database.auth.host | b64enc | quote }} {{- end }} - password: {{ $database.auth.password | b64enc | quote }} - port: {{ $database.auth.port | b64enc | quote }} - user: {{ $database.auth.username | b64enc | quote }} -{{- end }} + password: {{ required ".Values.database.auth.password is required." $database.auth.password | b64enc | quote | }} + port: {{ required ".Values.database.auth.port is required." $database.auth.port | b64enc | quote }} + user: {{ required ".Values.database.auth.username is required." $database.auth.username | b64enc | quote }} {{- end }}