helm-toolkit fix dependency resolver

Fixes an issue where dependencies are leaking from one resource to
another by ensuring that `envAll.Values.__dep` is reset each time.

Change-Id: I34a4b2fa70d608b2c69bdf18275e439f96976229
Closes-Bug: #1845538
This commit is contained in:
Sphicas, Phil (ps3910) 2019-09-26 09:59:04 -07:00
parent c3a1ae43fd
commit 750394ee54

View File

@ -27,8 +27,8 @@ limitations under the License.
{{- $_ := set $envAll.Values "pod_dependency" ( index $envAll.Values.dependencies.static $dependencyKey ) }}
{{- end }}
{{- else if kindIs "slice" $dependencyMixinParam }}
{{- $_ := set $envAll.Values "__deps" ( index $envAll.Values.dependencies.static $dependencyKey ) }}
{{- range $k, $v := $dependencyMixinParam -}}
{{- if not $envAll.Values.__deps }}{{- $_ := set $envAll.Values "__deps" ( index $envAll.Values.dependencies.static $dependencyKey ) }}{{- end }}
{{- $_ := include "helm-toolkit.utils.merge" (tuple $envAll.Values.pod_dependency $envAll.Values.__deps ( index $envAll.Values.dependencies.dynamic.targeted $v $dependencyKey ) ) -}}
{{- $_ := set $envAll.Values "__deps" $envAll.Values.pod_dependency -}}
{{- end }}