[COMMON] Handle generic secrets in secretFast 29/104429/2
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 25 Mar 2020 20:35:35 +0000 (21:35 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 26 Mar 2020 12:42:13 +0000 (12:42 +0000)
Generic secrets needs filePaths key in their dictionary which was not
correctly handled by previous implementation of secretFast.

Issue-ID: OOM-2051
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: Idc1062db5867bd23d580fbe59c90c0ce410151ce

kubernetes/common/common/templates/_secret.tpl

index a89ab6d..78e94ea 100644 (file)
@@ -189,12 +189,15 @@ type: Opaque
       {{- $entry := dict }}
       {{- $uid := tpl (default "" $secret.uid) $global }}
       {{- $keys := keys $secret }}
-      {{- range $key := (without $keys "annotations" )}}
+      {{- range $key := (without $keys "annotations" "filePaths" )}}
         {{- $_ := set $entry $key (tpl (index $secret $key) $global) }}
       {{- end }}
       {{- if $secret.annotations }}
         {{- $_ := set $entry "annotations" $secret.annotations }}
       {{- end }}
+      {{- if $secret.filePaths }}
+        {{- $_ := set $entry "filePaths" $secret.filePaths }}
+      {{- end }}
       {{- $realName := default (include "common.secret.genNameFast" (dict "global" $global "uid" $uid "name" $entry.name) ) $entry.externalSecret }}
       {{- $_ := set $entry "realName" $realName }}
       {{- $_ := set $secretCache $uid $entry }}