merge null child chart objects

Signed-off-by: Ryan Hockstad <ryanhockstad@gmail.com>
pull/12879/head
Ryan Hockstad 2 years ago
parent fa47752b89
commit 5a58751a05

@ -237,6 +237,9 @@ func coalesceValues(printf printFn, c *chart.Chart, v map[string]interface{}, pr
printf("warning: skipped value for %s.%s: Not a table.", subPrefix, key) printf("warning: skipped value for %s.%s: Not a table.", subPrefix, key)
} }
} else { } else {
// If the key is a child chart, coalesce tables with Merge set to true
merge := childChartMergeTrue(c, key, merge)
// Because v has higher precedence than nv, dest values override src // Because v has higher precedence than nv, dest values override src
// values. // values.
coalesceTablesFullKey(printf, dest, src, concatPrefix(subPrefix, key), merge) coalesceTablesFullKey(printf, dest, src, concatPrefix(subPrefix, key), merge)
@ -249,6 +252,15 @@ func coalesceValues(printf printFn, c *chart.Chart, v map[string]interface{}, pr
} }
} }
func childChartMergeTrue(chrt *chart.Chart, key string, merge bool) bool {
for _, subchart := range chrt.Dependencies() {
if subchart.Name() == key {
return true
}
}
return merge
}
// CoalesceTables merges a source map into a destination map. // CoalesceTables merges a source map into a destination map.
// //
// dest is considered authoritative. // dest is considered authoritative.

Loading…
Cancel
Save