mirror of
https://github.com/bitnami/charts.git
synced 2026-03-09 15:38:00 +08:00
[bitnami/mariadb] Fix mariadb upgrade (#16265)
* Fix mariadb upgrade Signed-off-by: sfelipe <sfelipe@vmware.com> * Bump chart version Signed-off-by: sfelipe <sfelipe@vmware.com> * Add helper function Signed-off-by: sfelipe <sfelipe@vmware.com> * Add forcePassword logic Signed-off-by: sfelipe <sfelipe@vmware.com> --------- Signed-off-by: sfelipe <sfelipe@vmware.com>
This commit is contained in:
committed by
GitHub
parent
eff20e2b81
commit
b4262dbaae
@@ -26,4 +26,4 @@ sources:
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/mariadb
|
||||
- https://github.com/prometheus/mysqld_exporter
|
||||
- https://mariadb.org
|
||||
version: 12.1.3
|
||||
version: 12.1.4
|
||||
|
||||
@@ -147,3 +147,13 @@ mariadb: architecture
|
||||
"replication". Please set a valid architecture (--set architecture="xxxx")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get existing password to access MariaDB
|
||||
*/}}
|
||||
{{- define "mariadb.secret.existPassword" -}}
|
||||
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (include "mariadb.secretName" .)).data -}}
|
||||
{{- if hasKey $secret "mariadb-password" }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{{- $host := include "mariadb.primary.fullname" . }}
|
||||
{{- $port := print .Values.primary.service.ports.mysql }}
|
||||
{{- $rootPassword := include "common.secrets.passwords.manage" (dict "secret" (include "mariadb.secretName" .) "key" "mariadb-root-password" "providedValues" (list "auth.rootPassword") "context" $) | trimAll "\"" | b64dec }}
|
||||
{{- $password := .Values.auth.password }}
|
||||
{{- if eq (include "mariadb.secret.existPassword" .) "true" }}
|
||||
{{- $password := include "common.secrets.passwords.manage" (dict "secret" (include "mariadb.secretName" .) "key" "mariadb-password" "providedValues" (list "auth.password") "context" $) | trimAll "\"" | b64dec }}
|
||||
{{- end }}
|
||||
{{- if eq (include "mariadb.createSecret" .) "true" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -26,7 +29,7 @@ data:
|
||||
{{- if (not .Values.auth.forcePassword) }}
|
||||
mariadb-password: {{ print $password | b64enc | quote }}
|
||||
{{- else }}
|
||||
mariadb-password: {{ required "A MariaDB Database Password is required!" .Values.auth.password | b64enc | quote }}
|
||||
mariadb-password: {{ required "A MariaDB Database Password is required!" $password | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.architecture "replication" }}
|
||||
@@ -87,7 +90,11 @@ data:
|
||||
{{- if $database }}
|
||||
database: {{ print $database | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.auth.forcePassword) (empty $password) }}
|
||||
password: {{ required "A MariaDB Database Password is required!" $password | b64enc | quote }}
|
||||
{{- else }}
|
||||
password: {{ print $password | b64enc | quote }}
|
||||
{{- end }}
|
||||
uri: {{ printf "mysql://%s:%s@%s:%s/%s" .Values.auth.username $password $host $port $database | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user