Merge "[DCAEGEN2] Upgrade vescollector to 1.9.2"
[oom.git] / kubernetes / common / common / templates / _mariadb.tpl
index d4af180..5021c50 100644 (file)
 # 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 -}}
+
+{{/*
+  UID of mariadb backup credentials
+*/}}
+{{- define "common.mariadb.secret.backupCredentialsUID" -}}
+  {{- printf "db-backup-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.
 */}}
 {{- define "common.mariadbService" -}}
   {{- if .Values.global.mariadbGalera.localCluster -}}
-    {{- index .Values "mariadb-galera" "service" "name" -}}
+    {{- index .Values "mariadb-galera" "nameOverride" -}}
   {{- else -}}
     {{- .Values.global.mariadbGalera.service -}}
   {{- end -}}