github.com/zsuzhengdu/helm@v3.0.0-beta.3+incompatible/cmd/helm/testdata/testcharts/lib-chart/templates/_util.tpl (about)

     1  {{- /*
     2  common.util.merge will merge two YAML templates and output the result.
     3  
     4  This takes an array of three values:
     5  - the top context
     6  - the template name of the overrides (destination)
     7  - the template name of the base (source)
     8  
     9  */ -}}
    10  {{- define "common.util.merge" -}}
    11  {{- $top := first . -}}
    12  {{- $overrides := fromYaml (include (index . 1) $top) | default (dict ) -}}
    13  {{- $tpl := fromYaml (include (index . 2) $top) | default (dict ) -}}
    14  {{- toYaml (merge $overrides $tpl) -}}
    15  {{- end -}}