Skip to content

Commit 17e5fca

Browse files
committed
more consistent securityContext
1 parent 96308f8 commit 17e5fca

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

templates/deployments.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ spec:
428428
- name: st2web
429429
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
430430
imagePullPolicy: {{ .Values.image.pullPolicy }}
431-
{{- with default .Values.securityContext .Values.st2web.securityContext }}
431+
{{- with .Values.st2web.securityContext | default .Values.securityContext }}
432432
securityContext: {{- toYaml . | nindent 10 }}
433433
{{- end }}
434434
ports:
@@ -515,7 +515,7 @@ spec:
515515
{{- with .Values.dnsConfig }}
516516
dnsConfig: {{- toYaml . | nindent 8 }}
517517
{{- end }}
518-
{{- with default .Values.podSecurityContext .Values.st2client.podSecurityContext }}
518+
{{- with .Values.st2client.podSecurityContext | default .Values.podSecurityContext }}
519519
securityContext: {{- toYaml . | nindent 8 }}
520520
{{- end }}
521521
{{- with .Values.st2web.nodeSelector }}
@@ -1187,7 +1187,7 @@ spec:
11871187
- name: {{ $name }}
11881188
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
11891189
imagePullPolicy: {{ $.Values.image.pullPolicy }}
1190-
{{- with default $.Values.securityContext $sensor.securityContext }}
1190+
{{- with $sensor.securityContext | default $.Values.securityContext }}
11911191
securityContext: {{- toYaml . | nindent 10 }}
11921192
{{- end }}
11931193
{{- with $sensor.readinessProbe }}
@@ -1282,7 +1282,7 @@ spec:
12821282
{{- with $.Values.dnsConfig }}
12831283
dnsConfig: {{- toYaml . | nindent 8 }}
12841284
{{- end }}
1285-
{{- with default $.Values.podSecurityContext $sensor.podSecurityContext }}
1285+
{{- with $sensor.podSecurityContext | default $.Values.podSecurityContext }}
12861286
securityContext: {{- toYaml . | nindent 8 }}
12871287
{{- end }}
12881288
{{- with $sensor.nodeSelector }}
@@ -1353,7 +1353,7 @@ spec:
13531353
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
13541354
{{- end }}
13551355
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
1356-
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
1356+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
13571357
securityContext: {{- toYaml . | nindent 10 }}
13581358
{{- end }}
13591359
# TODO: Add liveness/readiness probes (#3)
@@ -1436,7 +1436,7 @@ spec:
14361436
{{- with .Values.dnsConfig }}
14371437
dnsConfig: {{- toYaml . | nindent 8 }}
14381438
{{- end }}
1439-
{{- with default .Values.podSecurityContext .Values.st2actionrunner.podSecurityContext }}
1439+
{{- with .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
14401440
securityContext: {{- toYaml . | nindent 8 }}
14411441
{{- end }}
14421442
{{- with .Values.st2actionrunner.nodeSelector }}

templates/jobs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ spec:
644644
- name: generate-st2client-config
645645
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
646646
imagePullPolicy: {{ $.Values.image.pullPolicy }}
647-
{{- with default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
647+
{{- with $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
648648
securityContext: {{- toYaml . | nindent 10 }}
649649
{{- end }}
650650
envFrom:
@@ -721,7 +721,7 @@ spec:
721721
{{- with $.Values.dnsConfig }}
722722
dnsConfig: {{- toYaml . | nindent 8 }}
723723
{{- end }}
724-
{{- with $.Values.jobs.podSecurityContext | default $.Values.st2actionrunner.podSecurityContext | default $.Values.podSecurityContext }}
724+
{{- with .podSecurityContext | default $.Values.st2actionrunner.podSecurityContext | default $.Values.podSecurityContext }}
725725
securityContext: {{- toYaml . | nindent 8 }}
726726
{{- end }}
727727
{{- with $.Values.jobs.nodeSelector }}

values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,7 @@ jobs:
986986
# hook: post-install # required "helm.sh/hook"
987987
# hook_weight: 10 # optional hook_weight (defaults to 10)
988988
# resources: {} # optional definition of resources to request
989+
# podSecurityContext: {} # optional definition of pod securityContext override
989990
# securityContext: {} # optional definition of container securityContext override
990991
# command: # required command to run
991992
# - st2

0 commit comments

Comments
 (0)