From f7e92f1744ea0fc337c69be0b1923ee2a2b71c5f Mon Sep 17 00:00:00 2001 From: iiice_oo Date: Sat, 3 Feb 2024 02:27:44 +0800 Subject: [PATCH] fix: history-max does not work when exec helm upgrade (#507) Signed-off-by: iiiceoo --- pkg/dashboard/objects/releases.go | 1 + pkg/dashboard/server.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dashboard/objects/releases.go b/pkg/dashboard/objects/releases.go index ed3ef56d..e951192a 100644 --- a/pkg/dashboard/objects/releases.go +++ b/pkg/dashboard/objects/releases.go @@ -330,6 +330,7 @@ func (r *Release) Upgrade(repoChart string, version string, justTemplate bool, v } cmd := action.NewUpgrade(hc) + cmd.MaxHistory = r.Settings.MaxHistory cmd.Namespace = r.Settings.Namespace() cmd.Version = version diff --git a/pkg/dashboard/server.go b/pkg/dashboard/server.go index 1c901c51..e0206827 100644 --- a/pkg/dashboard/server.go +++ b/pkg/dashboard/server.go @@ -199,7 +199,6 @@ func NewHelmConfig(origSettings *cli.EnvSettings, ns string) (*action.Configurat helmDriver, log.Debugf); err != nil { return nil, errorx.Decorate(err, "failed to init Helm action config") } - actionConfig.Releases.MaxHistory = origSettings.MaxHistory return actionConfig, nil }