diff --git a/bitnami/mariadb/Chart.yaml b/bitnami/mariadb/Chart.yaml index 0fb1d5037f5728..ad7d8e7d2176b9 100644 --- a/bitnami/mariadb/Chart.yaml +++ b/bitnami/mariadb/Chart.yaml @@ -26,4 +26,4 @@ sources: - https://github.com/bitnami/bitnami-docker-mariadb - https://github.com/prometheus/mysqld_exporter - https://mariadb.org -version: 10.3.7 +version: 10.4.0 diff --git a/bitnami/mariadb/templates/_helpers.tpl b/bitnami/mariadb/templates/_helpers.tpl index 4a8bf7fae791bd..5f6f8f791e6c98 100644 --- a/bitnami/mariadb/templates/_helpers.tpl +++ b/bitnami/mariadb/templates/_helpers.tpl @@ -120,9 +120,8 @@ Return the secret with MariaDB credentials Return true if a secret object should be created for MariaDB */}} {{- define "mariadb.createSecret" -}} -{{- if and (not .Values.auth.existingSecret) (not .Values.auth.customPasswordFiles) }} +{{- if not (or .Values.auth.existingSecret .Values.auth.customPasswordFiles) }} {{- true -}} -{{- else -}} {{- end -}} {{- end -}} diff --git a/bitnami/mariadb/templates/secrets.yaml b/bitnami/mariadb/templates/secrets.yaml index 49660d3d8e100f..2ff62edd2493a7 100644 --- a/bitnami/mariadb/templates/secrets.yaml +++ b/bitnami/mariadb/templates/secrets.yaml @@ -13,27 +13,23 @@ metadata: {{- end }} type: Opaque data: - {{- if not (empty .Values.auth.rootPassword) }} - mariadb-root-password: {{ .Values.auth.rootPassword | b64enc | quote }} - {{- else if (not .Values.auth.forcePassword) }} - mariadb-root-password: {{ randAlphaNum 10 | b64enc | quote }} + {{- if (not .Values.auth.forcePassword) }} + mariadb-root-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "mariadb-root-password" "providedValues" (list "auth.rootPassword") "context" $) }} {{- else }} - mariadb-root-password: {{ required "A MariaDB Root Password is required!" .Values.auth.rootPassword }} + mariadb-root-password: {{ required "A MariaDB Root Password is required!" .Values.auth.rootPassword | b64enc | quote }} {{- end }} - {{- if and (not (empty .Values.auth.username)) (not (empty .Values.auth.password)) }} - mariadb-password: {{ .Values.auth.password | b64enc | quote }} - {{- else if (not .Values.auth.forcePassword) }} - mariadb-password: {{ randAlphaNum 10 | b64enc | quote }} + {{- if (not (empty .Values.auth.username)) }} + {{- if (not .Values.auth.forcePassword) }} + mariadb-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "mariadb-password" "providedValues" (list "auth.password") "context" $) }} {{- else }} - mariadb-password: {{ required "A MariaDB Database Password is required!" .Values.auth.password }} + mariadb-password: {{ required "A MariaDB Database Password is required!" .Values.auth.password | b64enc | quote }} + {{- end }} {{- end }} {{- if eq .Values.architecture "replication" }} - {{- if not (empty .Values.auth.replicationPassword) }} - mariadb-replication-password: {{ .Values.auth.replicationPassword | b64enc | quote }} - {{- else if (not .Values.auth.forcePassword) }} - mariadb-replication-password: {{ randAlphaNum 10 | b64enc | quote }} + {{- if (not .Values.auth.forcePassword) }} + mariadb-replication-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "mariadb-replication-password" "providedValues" (list "auth.replicationPassword") "context" $) }} {{- else }} - mariadb-replication-password: {{ required "A MariaDB Replication Password is required!" .Values.auth.replicationPassword }} + mariadb-replication-password: {{ required "A MariaDB Replication Password is required!" .Values.auth.replicationPassword | b64enc | quote }} {{- end }} {{- end }} {{- end }} diff --git a/bitnami/mariadb/values.yaml b/bitnami/mariadb/values.yaml index 597304cd837869..7ab7809f2f3d20 100644 --- a/bitnami/mariadb/values.yaml +++ b/bitnami/mariadb/values.yaml @@ -125,7 +125,7 @@ auth: ## @param auth.forcePassword Force users to specify required passwords ## forcePassword: false - ## @param auth.usePasswordFiles Mount credentials as a files instead of using an environment variable + ## @param auth.usePasswordFiles Mount credentials as files instead of using environment variables ## usePasswordFiles: false ## @param auth.customPasswordFiles Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication`