Skip to content

Commit 30b2a88

Browse files
Joel Diazarttor
authored andcommitted
further indent container securityContext values
The Deployment template generated for the section covering the container 'securityContext' (not the pod 'securityContext') looks like: resources: {{- toYaml .Values.controllerManager.manager.resources | nindent 10 }} securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext | nindent 8 }} securityContext: runAsNonRoot: true As can be seen with the container's 'resources' right above, the appropriate indentation for container values should be '10'. Otherwise, helm ends up outputting invalid Pod yaml: $ helm template mondoo-operator charts/mondoo-operator -n mondoo-operator --create-namespace --wait | grep -A 6 securityContext securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL privileged: false readOnlyRootFilesystem: true securityContext: runAsNonRoot: true serviceAccountName: mondoo-operator-controller-manager terminationGracePeriodSeconds: 10 If we were indeed templating data in the pod 'securityContext' (right below), then '8' would have been appropriate. Signed-off-by: Joel Diaz <[email protected]>
1 parent 81ba5a2 commit 30b2a88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/processor/security-context/container_security_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
const (
1212
sc = "securityContext"
1313
cscValueName = "containerSecurityContext"
14-
helmTemplate = "{{- toYaml .Values.%[1]s.%[2]s.containerSecurityContext | nindent 8 }}"
14+
helmTemplate = "{{- toYaml .Values.%[1]s.%[2]s.containerSecurityContext | nindent 10 }}"
1515
)
1616

1717
// ProcessContainerSecurityContext adds 'securityContext' to the podSpec in specMap, if it doesn't have one already defined.

0 commit comments

Comments
 (0)