Skip to content
Snippets Groups Projects
Commit a03eb6d7 authored by OZGCloud's avatar OZGCloud
Browse files

set pod securitycontext

parent 2ee332b9
No related branches found
No related tags found
No related merge requests found
...@@ -167,10 +167,8 @@ spec: ...@@ -167,10 +167,8 @@ spec:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- end }}
schedulerName: default-scheduler schedulerName: default-scheduler
{{- if (.Values.securityContext).fsGroup }} {{- with .Values.podSecurityContext }}
securityContext: securityContext:
fsGroup: {{ (.Values.securityContext).fsGroup }} {{ toYaml . | indent 8 }}
{{- else }}
securityContext: {}
{{- end }} {{- end }}
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
\ No newline at end of file
...@@ -71,7 +71,7 @@ tests: ...@@ -71,7 +71,7 @@ tests:
value: 1000 value: 1000
- it: check fsGroup - it: check fsGroup
set: set:
securityContext.fsGroup: 1000 podSecurityContext.fsGroup: 1000
asserts: asserts:
- equal: - equal:
path: spec.template.spec.securityContext.fsGroup path: spec.template.spec.securityContext.fsGroup
......
...@@ -168,9 +168,7 @@ spec: ...@@ -168,9 +168,7 @@ spec:
{{ else }} {{ else }}
- name: {{ .Release.Name }}-image-pull-secret - name: {{ .Release.Name }}-image-pull-secret
{{- end }} {{- end }}
{{- if (.Values.securityContext).fsGroup }} {{- with .Values.podSecurityContext }}
securityContext: securityContext:
fsGroup: {{ (.Values.securityContext).fsGroup }} {{ toYaml . | indent 12 }}
{{- else }}
securityContext: {}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -133,7 +133,7 @@ tests: ...@@ -133,7 +133,7 @@ tests:
workload: xta-adapter-cronjob workload: xta-adapter-cronjob
- it: check fsGroup - it: check fsGroup
set: set:
securityContext.fsGroup: 1000 podSecurityContext.fsGroup: 1000
asserts: asserts:
- equal: - equal:
path: spec.jobTemplate.spec.template.spec.securityContext.fsGroup path: spec.jobTemplate.spec.template.spec.securityContext.fsGroup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment