From cc1aec1b96bf91adbaf59a51544418fbf69acc4d Mon Sep 17 00:00:00 2001 From: scheleaap Date: Thu, 19 Mar 2020 18:44:36 +0100 Subject: [PATCH] [incubator/sparkoperator] Use `securitycontext` from the chart values for the init and cleanup jobs too (#21539) * Use `securitycontext` from the chart values for the init and cleanup jobs too Signed-off-by: Wout Maaskant * Bump version Signed-off-by: Wout Maaskant Co-authored-by: Wout Maaskant --- incubator/sparkoperator/Chart.yaml | 2 +- .../sparkoperator/templates/crd-cleanup-job.yaml | 12 ++++++++++++ .../sparkoperator/templates/webhook-cleanup-job.yaml | 6 ++++++ .../sparkoperator/templates/webhook-init-job.yaml | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/incubator/sparkoperator/Chart.yaml b/incubator/sparkoperator/Chart.yaml index 64a964043d..74d5b79afb 100644 --- a/incubator/sparkoperator/Chart.yaml +++ b/incubator/sparkoperator/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sparkoperator description: A Helm chart for Spark on Kubernetes operator -version: 0.6.7 +version: 0.6.8 appVersion: v1beta2-1.1.0-2.4.5 keywords: - spark diff --git a/incubator/sparkoperator/templates/crd-cleanup-job.yaml b/incubator/sparkoperator/templates/crd-cleanup-job.yaml index b1e5b0b77c..73d1b2abed 100644 --- a/incubator/sparkoperator/templates/crd-cleanup-job.yaml +++ b/incubator/sparkoperator/templates/crd-cleanup-job.yaml @@ -23,6 +23,12 @@ spec: - name: delete-sparkapp-crd image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }} imagePullPolicy: {{ .Values.imagePullPolicy }} + {{- if .Values.securityContext }} + securityContext: + {{- range $securityPolicy, $value := .Values.securityContext }} + {{ $securityPolicy }}: {{ $value }} + {{- end }} + {{- end }} command: - "/bin/sh" - "-c" @@ -35,6 +41,12 @@ spec: - name: delete-scheduledsparkapp-crd image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }} imagePullPolicy: {{ .Values.imagePullPolicy }} + {{- if .Values.securityContext }} + securityContext: + {{- range $securityPolicy, $value := .Values.securityContext }} + {{ $securityPolicy }}: {{ $value }} + {{- end }} + {{- end }} command: - "/bin/sh" - "-c" diff --git a/incubator/sparkoperator/templates/webhook-cleanup-job.yaml b/incubator/sparkoperator/templates/webhook-cleanup-job.yaml index 7ee257ac96..4cbbdf6f35 100644 --- a/incubator/sparkoperator/templates/webhook-cleanup-job.yaml +++ b/incubator/sparkoperator/templates/webhook-cleanup-job.yaml @@ -23,6 +23,12 @@ spec: - name: clean-secret image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }} imagePullPolicy: {{ .Values.imagePullPolicy }} + {{- if .Values.securityContext }} + securityContext: + {{- range $securityPolicy, $value := .Values.securityContext }} + {{ $securityPolicy }}: {{ $value }} + {{- end }} + {{- end }} command: - "/bin/sh" - "-c" diff --git a/incubator/sparkoperator/templates/webhook-init-job.yaml b/incubator/sparkoperator/templates/webhook-init-job.yaml index 10c4634140..ff67e0597e 100644 --- a/incubator/sparkoperator/templates/webhook-init-job.yaml +++ b/incubator/sparkoperator/templates/webhook-init-job.yaml @@ -23,5 +23,11 @@ spec: - name: main image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }} imagePullPolicy: {{ .Values.imagePullPolicy }} + {{- if .Values.securityContext }} + securityContext: + {{- range $securityPolicy, $value := .Values.securityContext }} + {{ $securityPolicy }}: {{ $value }} + {{- end }} + {{- end }} command: ["/usr/bin/gencerts.sh", "-n", "{{ .Release.Namespace }}", "-s", "{{ .Release.Name }}-webhook", "-p"] {{ end }}