From 641c79c90209dc1ff392357431a2cce557597838 Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Wed, 7 Feb 2018 15:22:43 -0600 Subject: [PATCH] Add deep merge utility to helm-toolkit Adds "helm-toolkit.utils.merge" which is a replacement for the upstream sprig "merge" function which didn't quite do what we wanted, specifically it didn't merge slices, it just overrode one with the other. This PS also updates existing callsites of the sprig merge with "helm-toolkit.utils.merge". Change-Id: I456349558d4cf941d1bcb07fc76d0688b0a10782 --- calico/templates/daemonset-calico-etcd.yaml | 3 +- calico/templates/daemonset-calico-node.yaml | 3 +- .../deployment-calico-kube-controllers.yaml | 3 +- .../templates/deployment-client.yaml | 3 +- .../templates/deployment-master.yaml | 3 +- elasticsearch/templates/statefulset-data.yaml | 3 +- .../templates/daemonset-kube-flannel-ds.yaml | 3 +- .../templates/daemonset-fluent-bit.yaml | 3 +- .../templates/deployment-fluentd.yaml | 3 +- grafana/templates/deployment.yaml | 3 +- helm-toolkit/templates/utils/_merge.tpl | 100 ++++++++++++++++++ kibana/templates/deployment.yaml | 3 +- kube-dns/templates/deployment-kube-dns.yaml | 3 +- nfs-provisioner/templates/deployment.yaml | 3 +- .../templates/statefulset.yaml | 3 +- .../templates/deployment.yaml | 3 +- .../templates/daemonset.yaml | 3 +- .../templates/deployment.yaml | 3 +- prometheus/templates/statefulset.yaml | 3 +- redis/templates/deployment.yaml | 3 +- .../templates/daemonset-registry-proxy.yaml | 3 +- registry/templates/deployment-registry.yaml | 3 +- registry/templates/job-bootstrap.yaml | 3 +- tiller/templates/deployment-tiller.yaml | 3 +- 24 files changed, 146 insertions(+), 23 deletions(-) create mode 100644 helm-toolkit/templates/utils/_merge.tpl diff --git a/calico/templates/daemonset-calico-etcd.yaml b/calico/templates/daemonset-calico-etcd.yaml index 504af39a6..2f7109c90 100644 --- a/calico/templates/daemonset-calico-etcd.yaml +++ b/calico/templates/daemonset-calico-etcd.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.daemonset_calico_etcd }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.etcd .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.etcd .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.etcd -}} {{- end -}} diff --git a/calico/templates/daemonset-calico-node.yaml b/calico/templates/daemonset-calico-node.yaml index 238478d72..41036585f 100644 --- a/calico/templates/daemonset-calico-node.yaml +++ b/calico/templates/daemonset-calico-node.yaml @@ -34,7 +34,8 @@ limitations under the License. {{- end -}} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.calico_node .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.calico_node .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.calico_node -}} {{- end -}} diff --git a/calico/templates/deployment-calico-kube-controllers.yaml b/calico/templates/deployment-calico-kube-controllers.yaml index a34d46455..06eb44e40 100644 --- a/calico/templates/deployment-calico-kube-controllers.yaml +++ b/calico/templates/deployment-calico-kube-controllers.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment_calico_kube_policy_controllers }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.calico_kube_policy_controllers .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.calico_kube_policy_controllers .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.calico_kube_policy_controllers -}} {{- end -}} diff --git a/elasticsearch/templates/deployment-client.yaml b/elasticsearch/templates/deployment-client.yaml index c1dd21f43..07ed9a7de 100644 --- a/elasticsearch/templates/deployment-client.yaml +++ b/elasticsearch/templates/deployment-client.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.elasticsearch_client .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.elasticsearch_client .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.elasticsearch_client -}} {{- end -}} diff --git a/elasticsearch/templates/deployment-master.yaml b/elasticsearch/templates/deployment-master.yaml index 3355e0326..8b02bcb60 100644 --- a/elasticsearch/templates/deployment-master.yaml +++ b/elasticsearch/templates/deployment-master.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment_master }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.elasticsearch_master .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.elasticsearch_master .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.elasticsearch_master -}} {{- end -}} diff --git a/elasticsearch/templates/statefulset-data.yaml b/elasticsearch/templates/statefulset-data.yaml index 33ad1e242..0eac6ac04 100644 --- a/elasticsearch/templates/statefulset-data.yaml +++ b/elasticsearch/templates/statefulset-data.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.statefulset_data }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.elasticsearch_data .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.elasticsearch_data .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.elasticsearch_data -}} {{- end -}} diff --git a/flannel/templates/daemonset-kube-flannel-ds.yaml b/flannel/templates/daemonset-kube-flannel-ds.yaml index e6d1160b6..6038b9b93 100644 --- a/flannel/templates/daemonset-kube-flannel-ds.yaml +++ b/flannel/templates/daemonset-kube-flannel-ds.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.daemonset_kube_flannel_ds }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.flannel .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.flannel .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.flannel -}} {{- end -}} diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index 062ed7b77..5e4239b1b 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- $dependencies := .Values.dependencies.fluentbit }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.fluentbit .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.fluentbit .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.fluentbit -}} {{- end -}} diff --git a/fluent-logging/templates/deployment-fluentd.yaml b/fluent-logging/templates/deployment-fluentd.yaml index fcaa1790b..1bc53dfbf 100644 --- a/fluent-logging/templates/deployment-fluentd.yaml +++ b/fluent-logging/templates/deployment-fluentd.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.fluentd .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.fluentd .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.fluentd -}} {{- end -}} diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index c3c67840b..de2a5ac6e 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.grafana .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.grafana .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.grafana -}} {{- end -}} diff --git a/helm-toolkit/templates/utils/_merge.tpl b/helm-toolkit/templates/utils/_merge.tpl new file mode 100644 index 000000000..3d5828849 --- /dev/null +++ b/helm-toolkit/templates/utils/_merge.tpl @@ -0,0 +1,100 @@ +{{/* +Copyright 2018 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{/* +Takes a tuple of values and merges into the first (target) one each subsequent +(source) one in order. If all values to merge are maps, then the tuple can be +passed as is and the target will be the result, otherwise pass a map with a +"values" key containing the tuple of values to merge, and the merge result will +be assigned to the "result" key of the passed map. + +When merging maps, for each key in the source, if the target does not define +that key, the source value is assigned. If both define the key, then the key +values are merged using this algorithm (recursively) and the result is assigned +to the target key. Slices are merged by appending them and removing any +duplicates. Any other values are merged by simply keeping the source, and +throwing away the target. +*/}} +{{- define "helm-toolkit.utils.merge" -}} + {{- $local := dict -}} + {{- if kindIs "map" $ -}} + {{- $_ := set $local "values" $.values -}} + {{- else -}} + {{- $_ := set $local "values" $ -}} + {{- end -}} + + {{- $target := first $local.values -}} + {{- range $item := rest $local.values -}} + {{- $call := dict "target" $target "source" . -}} + {{- $_ := include "helm-toolkit.utils._merge" $call -}} + {{- $_ := set $local "result" $call.result -}} + {{- end -}} + + {{- if kindIs "map" $ -}} + {{- $_ := set $ "result" $local.result -}} + {{- end -}} +{{- end -}} + +{{- define "helm-toolkit.utils._merge" -}} + {{- $local := dict -}} + + {{- $_ := set $ "result" $.source -}} + + {{/* + TODO: Should we `fail` when trying to merge a collection (map or slice) with + either a different kind of collection or a scalar? + */}} + + {{- if and (kindIs "map" $.target) (kindIs "map" $.source) -}} + {{- range $key, $sourceValue := $.source -}} + {{- if not (hasKey $.target $key) -}} + {{- $_ := set $local "newTargetValue" $sourceValue -}} + {{- if kindIs "map" $sourceValue -}} + {{- $copy := dict -}} + {{- $call := dict "target" $copy "source" $sourceValue -}} + {{- $_ := include "helm-toolkit.utils._merge.shallow" $call -}} + {{- $_ := set $local "newTargetValue" $copy -}} + {{- end -}} + {{- else -}} + {{- $targetValue := index $.target $key -}} + {{- $call := dict "target" $targetValue "source" $sourceValue -}} + {{- $_ := include "helm-toolkit.utils._merge" $call -}} + {{- $_ := set $local "newTargetValue" $call.result -}} + {{- end -}} + {{- $_ := set $.target $key $local.newTargetValue -}} + {{- end -}} + {{- $_ := set $ "result" $.target -}} + {{- else if and (kindIs "slice" $.target) (kindIs "slice" $.source) -}} + {{- $call := dict "target" $.target "source" $.source -}} + {{- $_ := include "helm-toolkit.utils._merge.append_slice" $call -}} + {{- $_ := set $ "result" (uniq $call.result) -}} + {{- end -}} +{{- end -}} + +{{- define "helm-toolkit.utils._merge.shallow" -}} + {{- range $key, $value := $.source -}} + {{- $_ := set $.target $key $value -}} + {{- end -}} +{{- end -}} + +{{- define "helm-toolkit.utils._merge.append_slice" -}} + {{- $local := dict -}} + {{- $_ := set $local "result" $.target -}} + {{- range $value := $.source -}} + {{- $_ := set $local "result" (append $local.result $value) -}} + {{- end -}} + {{- $_ := set $ "result" $local.result -}} +{{- end -}} diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index 3675ffa9d..482438e4c 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.kibana .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.kibana .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.kibana -}} {{- end -}} diff --git a/kube-dns/templates/deployment-kube-dns.yaml b/kube-dns/templates/deployment-kube-dns.yaml index 3e5eb79d3..11afe82b8 100644 --- a/kube-dns/templates/deployment-kube-dns.yaml +++ b/kube-dns/templates/deployment-kube-dns.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment_kube_dns }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.kube_dns .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.kube_dns .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.kube_dns -}} {{- end -}} diff --git a/nfs-provisioner/templates/deployment.yaml b/nfs-provisioner/templates/deployment.yaml index 7d88373c8..44193c263 100644 --- a/nfs-provisioner/templates/deployment.yaml +++ b/nfs-provisioner/templates/deployment.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.nfs .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.nfs .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.nfs -}} {{- end -}} diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index 6a88cb2ee..20a69100d 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.statefulset }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.alertmanager .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.alertmanager .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.alertmanager -}} {{- end -}} diff --git a/prometheus-kube-state-metrics/templates/deployment.yaml b/prometheus-kube-state-metrics/templates/deployment.yaml index 3f2dfb312..1560c119f 100644 --- a/prometheus-kube-state-metrics/templates/deployment.yaml +++ b/prometheus-kube-state-metrics/templates/deployment.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.kube_state_metrics .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.kube_state_metrics .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.kube_state_metrics -}} {{- end -}} diff --git a/prometheus-node-exporter/templates/daemonset.yaml b/prometheus-node-exporter/templates/daemonset.yaml index 61a894553..5d9b6635b 100644 --- a/prometheus-node-exporter/templates/daemonset.yaml +++ b/prometheus-node-exporter/templates/daemonset.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.daemonset }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.node_exporter .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.node_exporter .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.node_exporter -}} {{- end -}} diff --git a/prometheus-openstack-exporter/templates/deployment.yaml b/prometheus-openstack-exporter/templates/deployment.yaml index f7bc60978..acc5f17c8 100644 --- a/prometheus-openstack-exporter/templates/deployment.yaml +++ b/prometheus-openstack-exporter/templates/deployment.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- $ksUserSecret := .Values.secrets.identity.user }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.prometheus_openstack_exporter .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.prometheus_openstack_exporter .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.prometheus_openstack_exporter -}} {{- end -}} diff --git a/prometheus/templates/statefulset.yaml b/prometheus/templates/statefulset.yaml index 5e13e85c4..46a14c2bb 100644 --- a/prometheus/templates/statefulset.yaml +++ b/prometheus/templates/statefulset.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.statefulset_prometheus }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.prometheus .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.prometheus .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.prometheus -}} {{- end -}} diff --git a/redis/templates/deployment.yaml b/redis/templates/deployment.yaml index 27b7a6116..7db88ac8e 100644 --- a/redis/templates/deployment.yaml +++ b/redis/templates/deployment.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.redis .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.redis .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.redis -}} {{- end -}} diff --git a/registry/templates/daemonset-registry-proxy.yaml b/registry/templates/daemonset-registry-proxy.yaml index 012e93c58..84c982ac9 100644 --- a/registry/templates/daemonset-registry-proxy.yaml +++ b/registry/templates/daemonset-registry-proxy.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.daemonset_registry_proxy }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.registry_proxy .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.registry_proxy .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.registry_proxy -}} {{- end -}} diff --git a/registry/templates/deployment-registry.yaml b/registry/templates/deployment-registry.yaml index 6f507593a..df6cd23f4 100644 --- a/registry/templates/deployment-registry.yaml +++ b/registry/templates/deployment-registry.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment_registry }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.registry .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.registry .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.registry -}} {{- end -}} diff --git a/registry/templates/job-bootstrap.yaml b/registry/templates/job-bootstrap.yaml index 34375e7ac..4407ebf74 100644 --- a/registry/templates/job-bootstrap.yaml +++ b/registry/templates/job-bootstrap.yaml @@ -18,7 +18,8 @@ limitations under the License. {{- $envAll := . }} {{- if .Values.bootstrap.enabled }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.bootstrap .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.bootstrap .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.bootstrap -}} {{- end -}} diff --git a/tiller/templates/deployment-tiller.yaml b/tiller/templates/deployment-tiller.yaml index 0cac1bfa1..0a0368f9d 100644 --- a/tiller/templates/deployment-tiller.yaml +++ b/tiller/templates/deployment-tiller.yaml @@ -17,7 +17,8 @@ limitations under the License. {{- if .Values.manifests.deployment_tiller }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.tiller .Values.conditional_dependencies.local_image_registry) -}} +{{- $_ := set .Values "pod_dependency" dict -}} +{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.tiller .Values.conditional_dependencies.local_image_registry) -}} {{- else -}} {{- $_ := set .Values "pod_dependency" .Values.dependencies.tiller -}} {{- end -}}