From 655f171a7a0dce3de7a020590e932d9f0cb66891 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Sat, 16 Jun 2018 09:57:12 -0500 Subject: [PATCH] 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 --- helm-toolkit/templates/utils/_dependency_resolver.tpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm-toolkit/templates/utils/_dependency_resolver.tpl b/helm-toolkit/templates/utils/_dependency_resolver.tpl index b1b3bd4e5..f36fbee85 100644 --- a/helm-toolkit/templates/utils/_dependency_resolver.tpl +++ b/helm-toolkit/templates/utils/_dependency_resolver.tpl @@ -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 }}