From 14c77aa9913cf67ced55a0412e849ac5af849044 Mon Sep 17 00:00:00 2001 From: ferantivero Date: Fri, 22 Nov 2019 17:10:35 -0700 Subject: [PATCH] align export format behavior with parent-child format now export format will coalesce tables in the very same way as in parent-child format. - now both formats follow the leaft chart (subchart) wins. It means, values in child charts will propagate their values to parents charts solved: #7045 Signed-off-by: ferantivero --- pkg/chartutil/requirements.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/chartutil/requirements.go b/pkg/chartutil/requirements.go index fb2fe3b5a..7ef4e420a 100644 --- a/pkg/chartutil/requirements.go +++ b/pkg/chartutil/requirements.go @@ -441,12 +441,15 @@ func processImportValues(c *chart.Chart) error { } outiv = append(outiv, nm) s := name + "." + nm["child"] - vm, err := cvals.Table(s) + // get child table + vv, err := cvals.Table(s) if err != nil { log.Printf("Warning: ImportValues missing table: %v", err) continue } - b = coalesceTables(b, vm.AsMap(), c.Metadata.Name) + // create value map from child to be merged into parent + vm := pathToMap(nm["parent"], vv.AsMap()) + b = coalesceTables(b, vm, c.Metadata.Name) } } // set our formatted import values