diff --git a/helm-toolkit/templates/snippets/_kubernetes_pod_security_context.tpl b/helm-toolkit/templates/snippets/_kubernetes_pod_security_context.tpl index 018bd0a46..09afadf8d 100644 --- a/helm-toolkit/templates/snippets/_kubernetes_pod_security_context.tpl +++ b/helm-toolkit/templates/snippets/_kubernetes_pod_security_context.tpl @@ -40,7 +40,7 @@ return: | {{- $application := index . "application" -}} securityContext: runAsUser: {{ index $envAll.Values.pod.user $application "uid" }} -{{- if hasKey $envAll.Values.pod $application "security_context" }} +{{- if hasKey (index $envAll.Values.pod $application) "security_context" }} {{ toYaml (index $envAll.Values.pod $application "security_context") | indent 2 }} {{- end }} {{- end -}}