aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-init/templates/_mariadb.tpl
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2020-09-07 19:24:37 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-07 19:24:37 +0000
commitb816b184a2d83238a2f41a940b6fca874be297ef (patch)
treeac34fa7dc91e40da424b96d96d89bce9196281ed /kubernetes/common/mariadb-init/templates/_mariadb.tpl
parentefe953fd4066faa5d4cbe07287ccb172f631e1bd (diff)
parented7b049fe6646b36a0af1047e6126618e93d10bb (diff)
Merge "[COMMON] Use faster version of common secret template"
Diffstat (limited to 'kubernetes/common/mariadb-init/templates/_mariadb.tpl')
-rw-r--r--kubernetes/common/mariadb-init/templates/_mariadb.tpl13
1 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/common/mariadb-init/templates/_mariadb.tpl b/kubernetes/common/mariadb-init/templates/_mariadb.tpl
index af9a4f5f02..5563fe714d 100644
--- a/kubernetes/common/mariadb-init/templates/_mariadb.tpl
+++ b/kubernetes/common/mariadb-init/templates/_mariadb.tpl
@@ -1,5 +1,6 @@
{{/*
# Copyright © 2019 Orange
+# Copyright © 2020 Samsung Electronics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,3 +21,15 @@
{{- define "mariadbInit.mariadbClusterSecret" -}}
{{- include "common.mariadb.secret.rootPassSecretName" (dict "dot" . "chartName" (default "mariadb-galera" .Values.global.mariadbGalera.nameOverride)) -}}
{{- end -}}
+
+{{- define "mariadbInit._updateSecrets" -}}
+ {{- if not .Values.secretsUpdated }}
+ {{- $global := . }}
+ {{- range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases }}
+ {{- $item := dict "uid" $db "type" "basicAuth" "externalSecret" (default "" $dbInfos.externalSecret) "login" (default "" $dbInfos.user) "password" (default "" $dbInfos.password) "passwordPolicy" "required" }}
+ {{- $newList := append $global.Values.secrets $item }}
+ {{- $_ := set $global.Values "secrets" $newList }}
+ {{- end -}}
+ {{ $_ := set $global.Values "secretsUpdated" true }}
+ {{- end -}}
+{{- end -}}