fix reuse values

Signed-off-by: baoshenghua <baoshenghua@jd.com>
pull/9380/head
baoshenghua 5 years ago
parent 64c8df187a
commit 41dfd863f3

@ -442,15 +442,12 @@ func (u *Upgrade) reuseValues(chart *chart.Chart, current *release.Release, newV
if u.ReuseValues { if u.ReuseValues {
u.cfg.Log("reusing the old release's values") u.cfg.Log("reusing the old release's values")
// We have to regenerate the old coalesced values: // merge old chart values to new chart values
oldVals, err := chartutil.CoalesceValues(current.Chart, current.Config) mergedChartValues := chartutil.CoalesceTables(chart.Values, current.Chart.Values)
if err != nil {
return nil, errors.Wrap(err, "failed to rebuild old values")
}
newVals = chartutil.CoalesceTables(newVals, current.Config) newVals = chartutil.CoalesceTables(newVals, current.Config)
chart.Values = oldVals chart.Values = mergedChartValues
return newVals, nil return newVals, nil
} }

Loading…
Cancel
Save