14 lines
480 B
YAML
14 lines
480 B
YAML
|
{{- /*
|
||
|
lib.util.merge will merge two YAML templates and output the result.
|
||
|
This takes an array of three values:
|
||
|
- the top context
|
||
|
- the template name of the overrides (destination)
|
||
|
- the template name of the base (source)
|
||
|
*/}}
|
||
|
{{- define "lib.util.merge" -}}
|
||
|
{{- $top := first . -}}
|
||
|
{{- $overrides := fromYaml (include (index . 1) $top) | default (dict ) -}}
|
||
|
{{- $tpl := fromYaml (include (index . 2) $top) | default (dict ) -}}
|
||
|
{{- toYaml (merge $overrides $tpl) -}}
|
||
|
{{- end -}}
|