diff options
author | 2020-09-01 18:35:40 +0200 | |
---|---|---|
committer | 2020-09-06 21:45:11 +0530 | |
commit | ed7b049fe6646b36a0af1047e6126618e93d10bb (patch) | |
tree | 69a6799f841a375ef13499c5d36d109ab1f03b54 /kubernetes/common/mariadb-init/templates/_mariadb.tpl | |
parent | 80e39d45c38200dff1c20caf393db66c0d4a2316 (diff) |
[COMMON] Use faster version of common secret template
Replace all calls to common.secret in mariadb-init with
the faster version common.secretFast to save some linting time.
Issue-ID: OOM-2248
Change-Id: Id1658b46f3322ecc68155fafd72480e922978369
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'kubernetes/common/mariadb-init/templates/_mariadb.tpl')
-rw-r--r-- | kubernetes/common/mariadb-init/templates/_mariadb.tpl | 13 |
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 -}} |