[stable/mongodb] Do not set mongo password if username and database are not defined (#4955)

* Do not set mongo password if username and database are not defined

* Bump chart version
This commit is contained in:
Tomas Pizarro
2018-04-12 05:11:55 -07:00
committed by k8s-ci-robot
parent f356afd9b5
commit 45bffe4771
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: mongodb
version: 1.0.1
version: 1.0.2
appVersion: 3.7.3
description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications.
keywords:
+2
View File
@@ -35,11 +35,13 @@ spec:
key: mongodb-root-password
- name: MONGODB_USERNAME
value: {{ default "" .Values.mongodbUsername | quote }}
{{ if and .Values.mongodbUsername .Values.mongodbDatabase }}
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mongodb.fullname" . }}
key: mongodb-password
{{ end }}
- name: MONGODB_DATABASE
value: {{ default "" .Values.mongodbDatabase | quote }}
ports:
+2
View File
@@ -14,8 +14,10 @@ data:
{{ else }}
mongodb-root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
{{ if and .Values.mongodbUsername .Values.mongodbDatabase }}
{{ if .Values.mongodbPassword }}
mongodb-password: {{ .Values.mongodbPassword | b64enc | quote }}
{{ else }}
mongodb-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
{{ end }}