From c47ee3f0e2f257c4cddd56f22d9db69cbcc03ff2 Mon Sep 17 00:00:00 2001 From: michaelmccord Date: Mon, 25 Mar 2019 07:37:09 -0400 Subject: [PATCH] [stable/mongodb] - ensure that custom init script config maps are mounted when supplied and add *.json files to the list of files that are importable as init scripts (#12483) Signed-off-by: Michael McCord --- stable/mongodb/Chart.yaml | 2 +- stable/mongodb/templates/deployment-standalone.yaml | 4 ++-- stable/mongodb/templates/initialization-configmap.yaml | 4 ++-- stable/mongodb/templates/statefulset-primary-rs.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stable/mongodb/Chart.yaml b/stable/mongodb/Chart.yaml index 05b8782e79..2d2f6fb2d8 100644 --- a/stable/mongodb/Chart.yaml +++ b/stable/mongodb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mongodb -version: 5.14.0 +version: 5.14.1 appVersion: 4.0.7 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. keywords: diff --git a/stable/mongodb/templates/deployment-standalone.yaml b/stable/mongodb/templates/deployment-standalone.yaml index ceced2c7f8..4ad3099a9a 100644 --- a/stable/mongodb/templates/deployment-standalone.yaml +++ b/stable/mongodb/templates/deployment-standalone.yaml @@ -148,7 +148,7 @@ spec: volumeMounts: - name: data mountPath: /bitnami/mongodb - {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} + {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]") (.Values.initConfigMap) }} - name: custom-init-scripts mountPath: /docker-entrypoint-initdb.d {{- end }} @@ -193,7 +193,7 @@ spec: {{ toYaml .Values.metrics.resources | indent 10 }} {{- end }} volumes: - {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} + {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]") }} - name: custom-init-scripts configMap: name: {{ template "mongodb.fullname" . }}-init-scripts diff --git a/stable/mongodb/templates/initialization-configmap.yaml b/stable/mongodb/templates/initialization-configmap.yaml index 93f4033c5a..02da7dfbed 100644 --- a/stable/mongodb/templates/initialization-configmap.yaml +++ b/stable/mongodb/templates/initialization-configmap.yaml @@ -1,4 +1,4 @@ -{{ if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} +{{ if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]") }} apiVersion: v1 kind: ConfigMap metadata: @@ -9,5 +9,5 @@ metadata: release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} data: -{{ tpl (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]").AsConfig . | indent 2 }} {{ end }} diff --git a/stable/mongodb/templates/statefulset-primary-rs.yaml b/stable/mongodb/templates/statefulset-primary-rs.yaml index 87e4d01a95..bd87daf070 100644 --- a/stable/mongodb/templates/statefulset-primary-rs.yaml +++ b/stable/mongodb/templates/statefulset-primary-rs.yaml @@ -174,7 +174,7 @@ spec: volumeMounts: - name: datadir mountPath: /bitnami/mongodb - {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") (.Values.initConfigMap) }} + {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]") (.Values.initConfigMap) }} - name: custom-init-scripts mountPath: /docker-entrypoint-initdb.d {{- end }} @@ -219,7 +219,7 @@ spec: {{ toYaml .Values.metrics.resources | indent 12 }} {{- end }} volumes: - {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js]") }} + {{- if (.Files.Glob "files/docker-entrypoint-initdb.d/*[sh|js|json]") }} - name: custom-init-scripts configMap: name: {{ template "mongodb.fullname" . }}-init-scripts