Dependency Mixin: permit null value to be resolved

This PS udpate the dependency mixin function to permit cases where
the mixin is disabled by passing a null value as the key to use
for resolution.

Change-Id: Idcade7eebed317852b70392431ed02a352241c9b
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2018-06-16 09:57:12 -05:00
parent b0c34c4468
commit 655f171a7a

View File

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