From 0b505946bf1b92d57b4b7cb236dd8c22db4f037d Mon Sep 17 00:00:00 2001 From: Bendik Paulsrud Date: Fri, 30 Aug 2024 08:29:51 +0200 Subject: [PATCH] feat(helm): make securityContext conditional in Deployment and CronJob --- charts/descheduler/templates/cronjob.yaml | 2 ++ charts/descheduler/templates/deployment.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index cbfeca75b..097047345 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -91,8 +91,10 @@ spec: {{- toYaml .Values.livenessProbe | nindent 16 }} resources: {{- toYaml .Values.resources | nindent 16 }} + {{- if .Values.securityContext }} securityContext: {{- toYaml .Values.securityContext | nindent 16 }} + {{- end }} volumeMounts: - mountPath: /policy-dir name: policy-volume diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index 7820a2733..01609fe7f 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -67,8 +67,10 @@ spec: {{- toYaml .Values.livenessProbe | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.securityContext }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /policy-dir name: policy-volume