From 41dfd863f37631d65854ff739a0db4b31d9bdf07 Mon Sep 17 00:00:00 2001 From: baoshenghua Date: Thu, 18 Feb 2021 21:38:18 +0800 Subject: [PATCH] fix reuse values Signed-off-by: baoshenghua --- pkg/action/upgrade.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index b0f294cae..f8774c4fb 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -442,15 +442,12 @@ func (u *Upgrade) reuseValues(chart *chart.Chart, current *release.Release, newV if u.ReuseValues { u.cfg.Log("reusing the old release's values") - // We have to regenerate the old coalesced values: - oldVals, err := chartutil.CoalesceValues(current.Chart, current.Config) - if err != nil { - return nil, errors.Wrap(err, "failed to rebuild old values") - } + // merge old chart values to new chart values + mergedChartValues := chartutil.CoalesceTables(chart.Values, current.Chart.Values) newVals = chartutil.CoalesceTables(newVals, current.Config) - chart.Values = oldVals + chart.Values = mergedChartValues return newVals, nil }