summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-init/templates/job.yaml
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2020-01-08 18:35:44 +0100
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-01-13 13:41:02 +0000
commitf54d66828e8ad74df948116943d0790b833ccfe9 (patch)
tree0102e3e27202a60b120ea33d6385d7c9b16c55d7 /kubernetes/common/mariadb-init/templates/job.yaml
parente2a1371f57721792f72811a3f8449f578ede9452 (diff)
[COMMON] Improve mariadb-init job script
Replace two sets of commands with a simple loop. Issue-ID: OOM-2248 Change-Id: I83a748cdad256e7206310d45a987530b4acc621b Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'kubernetes/common/mariadb-init/templates/job.yaml')
-rw-r--r--kubernetes/common/mariadb-init/templates/job.yaml9
1 files changed, 7 insertions, 2 deletions
diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml
index 679c10c9a3..f3ff9934ab 100644
--- a/kubernetes/common/mariadb-init/templates/job.yaml
+++ b/kubernetes/common/mariadb-init/templates/job.yaml
@@ -1,4 +1,5 @@
# 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.
@@ -63,13 +64,17 @@ spec:
secretKeyRef:
name: {{ include "mariadbInit.mariadbClusterSecret" . }}
key: {{ .Values.global.mariadbGalera.userRootSecretKey }}
- - name: MYSQL_PASSWORD
+ - name: {{ printf "MYSQL_USER_%s" .Values.config.mysqlDatabase | upper }}
+ value: "{{ .Values.config.userName }}"
+ - name: {{ printf "MYSQL_PASSWORD_%s" .Values.config.mysqlDatabase | upper }}
valueFrom:
secretKeyRef:
name: {{ template "common.fullname" . }}
key: db-user-password
{{- $root := . }}
-{{ range $db, $_value := .Values.config.mysqlAdditionalDatabases }}
+{{ range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases }}
+ - name: {{ printf "MYSQL_USER_%s" $db | upper }}
+ value: {{ $dbInfos.user }}
- name: {{ printf "MYSQL_PASSWORD_%s" $db | upper }}
valueFrom:
secretKeyRef: