From 2f4694825975de7848eb591d0d96f3a949e97762 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Fri, 14 Dec 2018 10:32:21 -0600 Subject: [PATCH] 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 --- .../templates/snippets/_kubernetes_pod_security_context.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -}}