From 3f3edb98e486b563ffc9a9a2ec92f7fecb52ef5e Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Thu, 19 Dec 2019 10:57:57 -0800 Subject: [PATCH] [stable/sonarqube] Make sure the sonarqube data directories have the right owner to be written to (#17001) * Make sure the sonarqube data directories have the right owner to be written to Signed-off-by: Gavin Mogan * mkdir and chmod all the directories Signed-off-by: Gavin Mogan * Bump helm chart version Signed-off-by: Gavin Mogan --- stable/sonarqube/Chart.yaml | 2 +- stable/sonarqube/templates/deployment.yaml | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/stable/sonarqube/Chart.yaml b/stable/sonarqube/Chart.yaml index 692aaec4e6..25778286e8 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: 3.2.6 +version: 3.2.7 appVersion: 7.9.1 keywords: - coverage diff --git a/stable/sonarqube/templates/deployment.yaml b/stable/sonarqube/templates/deployment.yaml index 458a5bce79..0a15b781fe 100644 --- a/stable/sonarqube/templates/deployment.yaml +++ b/stable/sonarqube/templates/deployment.yaml @@ -35,6 +35,35 @@ spec: securityContext: {{ toYaml .Values.securityContext | indent 8 }} initContainers: + - name: chmod-volume-mounts + command: + - "sh" + - "-c" + - 'mkdir -p $(printf "/opt/sonarqube/${1-%s\n}" temp logs data extensions/downloads extensions/plugins/tmp extensions/plugins) && + chown 999:999 -R $(printf "/opt/sonarqube/${1-%s\n}" temp logs data extensions/downloads extensions/plugins/tmp extensions/plugins)' + image: busybox:1.31 + imagePullPolicy: IfNotPresent + securityContext: + privileged: true + volumeMounts: + - mountPath: /opt/sonarqube/temp + name: sonarqube + subPath: temp + - mountPath: /opt/sonarqube/logs + name: sonarqube + subPath: logs + - mountPath: /opt/sonarqube/data + name: sonarqube + subPath: data + - mountPath: /opt/sonarqube/extensions/plugins/tmp + name: sonarqube + subPath: tmp + - mountPath: /opt/sonarqube/extensions/downloads + name: sonarqube + subPath: downloads + - mountPath: /opt/sonarqube/extensions/plugins + name: sonarqube + subPath: plugins {{- if .Values.elasticsearch.configureNode }} - name: init-sysctl image: {{ default "busybox:1.31" .Values.plugins.initSysctlContainerImage }}