2 # Copyright © 2019 Orange
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 UID of mariadb root password
20 {{- define "common.mariadb.secret.rootPassUID" -}}
21 {{- printf "db-root-password" }}
25 Name of mariadb secret
27 {{- define "common.mariadb.secret._secretName" -}}
28 {{- $global := .dot }}
29 {{- $chartName := tpl .chartName $global -}}
30 {{- include "common.secret.genName" (dict "global" $global "uid" (include .uidTemplate $global) "chartName" $chartName) }}
34 Name of mariadb root password secret
36 {{- define "common.mariadb.secret.rootPassSecretName" -}}
37 {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.rootPassUID") }}
41 UID of mariadb user credentials
43 {{- define "common.mariadb.secret.userCredentialsUID" -}}
44 {{- printf "db-user-credentials" }}
48 Name of mariadb user credentials secret
50 {{- define "common.mariadb.secret.userCredentialsSecretName" -}}
51 {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.userCredentialsUID") }}
55 Choose the name of the mariadb service to use.
57 {{- define "common.mariadbService" -}}
58 {{- if .Values.global.mariadbGalera.localCluster -}}
59 {{- index .Values "mariadb-galera" "service" "name" -}}
61 {{- .Values.global.mariadbGalera.service -}}
66 Choose the value of mariadb port to use.
68 {{- define "common.mariadbPort" -}}
69 {{- if .Values.global.mariadbGalera.localCluster -}}
70 {{- index .Values "mariadb-galera" "service" "internalPort" -}}
72 {{- .Values.global.mariadbGalera.internalPort -}}
77 Choose the value of secret to retrieve user value.
79 {{- define "common.mariadbSecret" -}}
80 {{- if .Values.global.mariadbGalera.localCluster -}}
81 {{ printf "%s-%s-db-user-credentials" (include "common.fullname" .) (index .Values "mariadb-galera" "nameOverride") -}}
83 {{ printf "%s-%s-%s" ( include "common.release" .) (index .Values "mariadb-init" "nameOverride") (index .Values "mariadb-init" "config" "mysqlDatabase" ) -}}
88 Choose the value of secret param to retrieve user value.
90 {{- define "common.mariadbSecretParam" -}}
91 {{ printf "password" -}}