X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fcommon%2Ftemplates%2F_mariadb.tpl;h=df0e6b41c9f238bcbe7d9917d7b1acf7ca158cd8;hb=263c0a0b4f5ffb9df8b149be1c8c703410515090;hp=cd7142fd7367768a2223011c79ffc7a2a760b061;hpb=45af03afbe57b068ebffb45e91c230cc50d4344c;p=oom.git diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl index cd7142fd73..df0e6b41c9 100644 --- a/kubernetes/common/common/templates/_mariadb.tpl +++ b/kubernetes/common/common/templates/_mariadb.tpl @@ -14,6 +14,43 @@ # limitations under the License. */}} +{{/* + UID of mariadb root password +*/}} +{{- define "common.mariadb.secret.rootPassUID" -}} + {{- printf "db-root-password" }} +{{- end -}} + +{{/* + Name of mariadb secret +*/}} +{{- define "common.mariadb.secret._secretName" -}} + {{- $global := .dot }} + {{- $chartName := tpl .chartName $global -}} + {{- include "common.secret.genName" (dict "global" $global "uid" (include .uidTemplate $global) "chartName" $chartName) }} +{{- end -}} + +{{/* + Name of mariadb root password secret +*/}} +{{- define "common.mariadb.secret.rootPassSecretName" -}} + {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.rootPassUID") }} +{{- end -}} + +{{/* + UID of mariadb user credentials +*/}} +{{- define "common.mariadb.secret.userCredentialsUID" -}} + {{- printf "db-user-credentials" }} +{{- end -}} + +{{/* + Name of mariadb user credentials secret +*/}} +{{- define "common.mariadb.secret.userCredentialsSecretName" -}} + {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.userCredentialsUID") }} +{{- end -}} + {{/* Choose the name of the mariadb service to use. */}} @@ -41,9 +78,9 @@ */}} {{- define "common.mariadbSecret" -}} {{- if .Values.global.mariadbGalera.localCluster -}} - {{ printf "%s-%s" (include "common.fullname" .) (index .Values "mariadb-galera" "nameOverride") -}} + {{ printf "%s-%s-db-user-credentials" (include "common.fullname" .) (index .Values "mariadb-galera" "nameOverride") -}} {{- else -}} - {{ printf "%s-%s" (.Release.Name) (index .Values "mariadb-init" "nameOverride") -}} + {{ printf "%s-%s-%s" ( include "common.release" .) (index .Values "mariadb-init" "nameOverride") (index .Values "mariadb-init" "config" "mysqlDatabase" ) -}} {{- end -}} {{- end -}} @@ -51,9 +88,5 @@ Choose the value of secret param to retrieve user value. */}} {{- define "common.mariadbSecretParam" -}} - {{- if .Values.global.mariadbGalera.localCluster -}} - {{ printf "user-password" -}} - {{- else -}} - {{ printf "db-user-password" -}} - {{- end -}} + {{ printf "password" -}} {{- end -}}