From c64bdd850ffc390ee442f9de3476315fbb7c22ab Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 17 Jun 2019 22:52:18 +0200 Subject: [PATCH] Use sonarProperties variable as dict (#14223) Signed-off-by: Roman Komkov --- stable/sonarqube/Chart.yaml | 2 +- stable/sonarqube/README.md | 1 + stable/sonarqube/templates/config.yaml | 6 ++++-- stable/sonarqube/values.yaml | 10 +++++----- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/stable/sonarqube/Chart.yaml b/stable/sonarqube/Chart.yaml index 348f046ee1..9a17d407f8 100644 --- a/stable/sonarqube/Chart.yaml +++ b/stable/sonarqube/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sonarqube description: Sonarqube is an open sourced code quality scanning tool -version: 1.1.1 +version: 2.0.0 appVersion: 7.7 keywords: - coverage diff --git a/stable/sonarqube/README.md b/stable/sonarqube/README.md index d218933694..b5a3d4517a 100644 --- a/stable/sonarqube/README.md +++ b/stable/sonarqube/README.md @@ -65,6 +65,7 @@ The following table lists the configurable parameters of the Sonarqube chart and | `customCerts.enabled` | Use `customCerts.secretName` | false | | `customCerts.secretName` | Name of the secret which conatins your `cacerts` | false | | `sonarSecretKey` | Name of existing secret used for settings encryption | None | +| `sonarProperties` | Custom `sonar.properties` file | `{}` | | `database.type` | Set to "mysql" to use mysql database | `postgresql`| | `postgresql.enabled` | Set to `false` to use external server / mysql database | `true` | | `postgresql.postgresServer` | Hostname of the external Postgresql server| `null` | diff --git a/stable/sonarqube/templates/config.yaml b/stable/sonarqube/templates/config.yaml index 01d1e334f1..edc5f57b1a 100644 --- a/stable/sonarqube/templates/config.yaml +++ b/stable/sonarqube/templates/config.yaml @@ -10,11 +10,13 @@ metadata: heritage: {{ .Release.Service }} data: {{- if and .Values.sonarSecretKey (not .Values.sonarProperties) }} - sonar.properties: sonar.secretKeyPath=/opt/sonarqube/secret/sonar-secret.txt + sonar.properties: sonar.secretKeyPath=/opt/sonarqube/secret/sonar-secret.txt {{- end }} {{- if .Values.sonarProperties }} sonar.properties: -{{ toYaml .Values.sonarProperties | indent 4 }} + {{ range $key, $val := .Values.sonarProperties }} + {{ $key }}={{ $val }} + {{ end }} {{- end }} {{- if and .Values.sonarSecretKey .Values.sonarProperties }} sonar.secretKeyPath=/opt/sonarqube/secret/sonar-secret.txt diff --git a/stable/sonarqube/values.yaml b/stable/sonarqube/values.yaml index 222241d586..5a728094f3 100755 --- a/stable/sonarqube/values.yaml +++ b/stable/sonarqube/values.yaml @@ -131,12 +131,12 @@ plugins: # We allow the plugins init container to have a separate resources declaration because # the initContainer does not take as much resources. -# A custom sonar.properties file can be provided using a multiline YAML string. +# A custom sonar.properties file can be provided via dictionary. # For example: -# sonarProperties: | -# sonar.forceAuthentication=true -# sonar.security.realm=LDAP -# ldap.url=ldaps://organization.com +# sonarProperties: +# sonar.forceAuthentication: true +# sonar.security.realm: LDAP +# ldap.url: ldaps://organization.com # Kubernetes secret that contains the encryption key for the sonarqube instance. # The secret must contain the key 'sonar-secret.txt'.