From ed7b049fe6646b36a0af1047e6126618e93d10bb Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Tue, 1 Sep 2020 18:35:40 +0200 Subject: [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 --- kubernetes/common/mariadb-init/templates/_mariadb.tpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'kubernetes/common/mariadb-init/templates/_mariadb.tpl') 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 -}} -- cgit 1.2.3-korg