Helm-toolkit: Fix hasKey call for security context snippet

This fixes the hasKey call in the pod security context snippet
template, as the call requires 2 args: a map and a key. This
addresses the problem by indexing the provided map on the
application key, before passing it to the hasKey call

Change-Id: I95264c933b51e2a8e38f63faa1e239bb3c1ebfda
This commit is contained in:
Steve Wilkerson 2018-12-14 10:32:21 -06:00
parent 80d5b4a84e
commit 2f46948259

View File

@ -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 -}}