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 <v-fean@microsoft.com>
pull/7047/head
ferantivero 6 years ago
parent 0c2221b6c9
commit 14c77aa991

@ -441,12 +441,15 @@ func processImportValues(c *chart.Chart) error {
} }
outiv = append(outiv, nm) outiv = append(outiv, nm)
s := name + "." + nm["child"] s := name + "." + nm["child"]
vm, err := cvals.Table(s) // get child table
vv, err := cvals.Table(s)
if err != nil { if err != nil {
log.Printf("Warning: ImportValues missing table: %v", err) log.Printf("Warning: ImportValues missing table: %v", err)
continue 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 // set our formatted import values

Loading…
Cancel
Save