From f5e74e506c8ae56f4a7af7dfa516c5733fadb22e Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Thu, 23 Apr 2020 00:11:44 +0200 Subject: [COMMON] Allow to use ' in mysql passwords derivePassword which we use to generate our passwords includes ' in set of special characters that can be used in passwords. Current implementation of bitnami configure-mysql.sh simply concatenates password surrounded with '' rest of SQL query. This causes issues if password contains ' as it creates invalid SQL statement. To fix this issue we just patch the script and escape the special ' character in password. Issue-ID: OOM-2246 Reported-by: Mateusz Pilat Signed-off-by: Krzysztof Opasiak Change-Id: I3d2150760755e55558e2045cbb7ca5693c8ab71f Signed-off-by: Krzysztof Opasiak --- .../common/mariadb-galera/templates/configmap.yaml | 16 +++++++++++++++- .../common/mariadb-galera/templates/statefulset.yaml | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'kubernetes/common/mariadb-galera/templates') diff --git a/kubernetes/common/mariadb-galera/templates/configmap.yaml b/kubernetes/common/mariadb-galera/templates/configmap.yaml index e7bb701930..a7064d7ce4 100644 --- a/kubernetes/common/mariadb-galera/templates/configmap.yaml +++ b/kubernetes/common/mariadb-galera/templates/configmap.yaml @@ -1,5 +1,6 @@ {{/* # Copyright © 2018 Amdocs, Bell Canada +# 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. @@ -28,4 +29,17 @@ metadata: data: my_extra.cnf: | {{ .Values.externalConfig | indent 4 }} -{{- end -}} +{{- end }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ include "common.release" . }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/common/mariadb-galera/templates/statefulset.yaml b/kubernetes/common/mariadb-galera/templates/statefulset.yaml index 7157e3390b..855d50e5ea 100644 --- a/kubernetes/common/mariadb-galera/templates/statefulset.yaml +++ b/kubernetes/common/mariadb-galera/templates/statefulset.yaml @@ -47,6 +47,10 @@ spec: configMap: name: {{ include "common.fullname" . }}-external-config {{- end}} + - name: init-script + configMap: + name: {{ include "common.fullname" . }} + defaultMode: 0755 - name: localtime hostPath: path: /etc/localtime @@ -104,6 +108,9 @@ spec: - mountPath: /etc/localtime name: localtime readOnly: true + - mountPath: /usr/share/container-scripts/mysql/configure-mysql.sh + subPath: configure-mysql.sh + name: init-script {{- if .Values.persistence.enabled }} - mountPath: /var/lib/mysql name: {{ include "common.fullname" . }}-data -- cgit 1.2.3-korg