From 287abd5d307ade3a93a37dc73a00e0c9a4e72b65 Mon Sep 17 00:00:00 2001 From: Michael Laccetti Date: Thu, 3 May 2018 16:37:52 -0400 Subject: [PATCH] Create a secret for external PostgreSQL instances (#5351) * Create a secret for external PostgreSQL instances * Bump the chart version * Add whitespace at the end of the file * Create a secret for external PostgreSQL instances * Add whitespace at the end of the file * Bump version --- stable/sonarqube/Chart.yaml | 2 +- stable/sonarqube/templates/deployment.yaml | 2 +- stable/sonarqube/templates/secret.yaml | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 stable/sonarqube/templates/secret.yaml diff --git a/stable/sonarqube/Chart.yaml b/stable/sonarqube/Chart.yaml index fc74b6106a..6ac55033e7 100644 --- a/stable/sonarqube/Chart.yaml +++ b/stable/sonarqube/Chart.yaml @@ -1,6 +1,6 @@ name: sonarqube description: Sonarqube is an open sourced code quality scanning tool -version: 0.5.4 +version: 0.5.5 appVersion: 6.7.3 keywords: - coverage diff --git a/stable/sonarqube/templates/deployment.yaml b/stable/sonarqube/templates/deployment.yaml index 8e62573c7c..a904bb1ff8 100644 --- a/stable/sonarqube/templates/deployment.yaml +++ b/stable/sonarqube/templates/deployment.yaml @@ -78,7 +78,7 @@ spec: - name: SONARQUBE_JDBC_PASSWORD valueFrom: secretKeyRef: - name: {{ template "postgresql.fullname" .}} + name: {{- if .Values.postgresql.enabled }} {{ template "postgresql.fullname" .}} {{- else }} {{ template "sonarqube.fullname" . }} {{- end }} key: postgres-password - name: SONARQUBE_JDBC_URL value: "jdbc:postgresql://{{ template "postgresql.hostname" . }}:{{- .Values.postgresql.service.port -}}/{{- .Values.postgresql.postgresDatabase -}}" diff --git a/stable/sonarqube/templates/secret.yaml b/stable/sonarqube/templates/secret.yaml new file mode 100644 index 0000000000..e11011589b --- /dev/null +++ b/stable/sonarqube/templates/secret.yaml @@ -0,0 +1,14 @@ +{{- if eq .Values.postgresql.enabled false -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "sonarqube.fullname" . }} + labels: + app: {{ template "sonarqube.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + postgres-password: {{ .Values.postgresql.postgresPassword | b64enc | quote }} +{{- end -}}