merge null child chart objects

Signed-off-by: Ryan Hockstad <ryanhockstad@gmail.com>
(cherry picked from commit 5a58751a05)
pull/13525/head
Ryan Hockstad 2 years ago committed by Matt Farina
parent ab7dedd4cf
commit 9520c71fb0
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -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)
}
} 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
// values.
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.
//
// dest is considered authoritative.

Loading…
Cancel
Save