Skip to content

Commit 8848ba8

Browse files
fix: correct pod security context block indentation
1 parent 12d4b46 commit 8848ba8

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

snyk-monitor/templates/deployment.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ spec:
3333
{{- toYaml . | nindent 8 }}
3434
{{- end }}
3535
spec:
36-
{{- with .Values.podSecurityContext }}
37-
securityContext:
38-
{{- $fsGroupOverride := dict }}
39-
{{- if hasKey $.Values.securityContext "fsGroup" }}
40-
{{- $fsGroupOverride = dict "fsGroup" (int $.Values.securityContext.fsGroup) }}
41-
{{- end }}
42-
{{- merge $fsGroupOverride . | toYaml | nindent 8 }}
43-
{{- else }}
44-
{{- if .Values.securityContext.fsGroup }}
45-
securityContext:
46-
fsGroup: {{ int .Values.securityContext.fsGroup }}
47-
{{- end }}
48-
{{- end }}
36+
{{- with .Values.podSecurityContext }}
37+
securityContext:
38+
{{- $fsGroupOverride := dict }}
39+
{{- if hasKey $.Values.securityContext "fsGroup" }}
40+
{{- $fsGroupOverride = dict "fsGroup" (int $.Values.securityContext.fsGroup) }}
41+
{{- end }}
42+
{{- merge $fsGroupOverride . | toYaml | nindent 8 }}
43+
{{- else }}
44+
{{- if .Values.securityContext.fsGroup }}
45+
securityContext:
46+
fsGroup: {{ int .Values.securityContext.fsGroup }}
47+
{{- end }}
48+
{{- end }}
4949
affinity:
5050
nodeAffinity:
5151
requiredDuringSchedulingIgnoredDuringExecution:

test/integration/kubernetes.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,15 @@ test('snyk-monitor secure configuration is as expected', async () => {
776776
namespace,
777777
);
778778
const deployment = response.body;
779+
expect(deployment.spec?.template.spec).toEqual(
780+
expect.objectContaining({
781+
securityContext: {
782+
fsGroup: 65534,
783+
fsGroupChangePolicy: 'Always',
784+
},
785+
}),
786+
);
787+
779788
expect(deployment.spec?.template?.spec?.containers?.[0]).toEqual(
780789
expect.objectContaining({
781790
securityContext: {

test/setup/deployers/helm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async function deployKubernetesMonitor(
3939
'--set rbac.serviceAccount.annotations."foo"="bar" ' +
4040
'--set volumes.projected.serviceAccountToken=true ' +
4141
'--set securityContext.fsGroup=65534 ' +
42+
'--set podSecurityContext.fsGroupChangePolicy="Always" ' +
4243
'--set skopeo.compression.level=1 ' +
4344
'--set workers.count=5 ' +
4445
'--set sysdig.enabled=true ',

0 commit comments

Comments
 (0)