From 10a66ec63278e481ea999af80b2c07efe29f2cac Mon Sep 17 00:00:00 2001 From: yivantsov-atlassian <52448429+bianchi2@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:49:17 +1100 Subject: [PATCH] Disable securityContext when run on OpenShift (#748) Co-authored-by: Yevhen Ivantsov --- src/main/charts/common/Chart.yaml | 4 ++-- src/main/charts/common/templates/_jmx.tpl | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/charts/common/Chart.yaml b/src/main/charts/common/Chart.yaml index bbc82a392..3dd559f8f 100644 --- a/src/main/charts/common/Chart.yaml +++ b/src/main/charts/common/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 name: common description: A Library Helm Chart for grouping common logic between Atlassian charts. This chart is not deployable by itself. type: library -version: 1.2.5 +version: 1.2.6 # Please make sure that version and appVersion are always the same. -appVersion: 1.2.5 +appVersion: 1.2.6 keywords: - common - helper diff --git a/src/main/charts/common/templates/_jmx.tpl b/src/main/charts/common/templates/_jmx.tpl index 919fc9ccf..4352accd6 100644 --- a/src/main/charts/common/templates/_jmx.tpl +++ b/src/main/charts/common/templates/_jmx.tpl @@ -36,6 +36,8 @@ Jmx init container {{- toYaml . | nindent 4 }} {{- end }} {{- end }} + {{- if .Values.openshift.runWithRestrictedSCC }} + {{- else}} {{- if .Values.monitoring.jmxExporterInitContainer.runAsRoot }} securityContext: runAsUser: 0 @@ -45,6 +47,7 @@ Jmx init container {{- toYaml . | nindent 4 }} {{- end }} {{- end }} + {{- end }} volumeMounts: - mountPath: {{ .Values.volumes.sharedHome.mountPath | quote }} name: shared-home