From 795534f9687e00a99c0c3aa55c0afa9a7299cc9d Mon Sep 17 00:00:00 2001 From: Umut Polat <52835619+umut-polat@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:40:37 +0000 Subject: [PATCH] fix(list): reintroduce deprecated --all/-a flag for backward compatibility In Helm v4, 'helm list' shows all releases by default, making the --all/-a flag unnecessary. However, removing the flag entirely was a breaking change that broke existing scripts and automation. This reintroduces --all/-a as a deprecated no-op flag that emits a warning, easing the transition for users upgrading from Helm v3. Fixes #31784 Signed-off-by: Umut Polat <52835619+umut-polat@users.noreply.github.com> --- pkg/cmd/list.go | 7 +++++++ pkg/cmd/list_test.go | 10 ++++++++++ pkg/cmd/testdata/output/list-all-deprecated.txt | 10 ++++++++++ 3 files changed, 27 insertions(+) create mode 100644 pkg/cmd/testdata/output/list-all-deprecated.txt diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index 3c15a0954..4c2cc26df 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -136,6 +136,13 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { f.StringVarP(&client.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Works only for secret(default) and configmap storage backends.") bindOutputFlag(cmd, &outfmt) + // deprecated flags -- kept for backwards compatibility with helm v3 scripts + var all bool + f.BoolVarP(&all, "all", "a", false, "show all releases without any filter applied (default behavior in v4)") + if err := cmd.Flags().MarkDeprecated("all", "this is now the default behavior in Helm v4 and this flag will be removed in a future release"); err != nil { + panic(err) + } + return cmd } diff --git a/pkg/cmd/list_test.go b/pkg/cmd/list_test.go index 35153465a..479f399b6 100644 --- a/pkg/cmd/list_test.go +++ b/pkg/cmd/list_test.go @@ -234,6 +234,16 @@ func TestListCmd(t *testing.T) { cmd: "list -n milano", golden: "output/list-namespace.txt", rels: releaseFixture, + }, { + name: "list with deprecated --all flag produces same output", + cmd: "list --all", + golden: "output/list-all-deprecated.txt", + rels: releaseFixture, + }, { + name: "list with deprecated -a flag produces same output", + cmd: "list -a", + golden: "output/list-all-deprecated.txt", + rels: releaseFixture, }} runTestCmd(t, tests) } diff --git a/pkg/cmd/testdata/output/list-all-deprecated.txt b/pkg/cmd/testdata/output/list-all-deprecated.txt new file mode 100644 index 000000000..75d094c97 --- /dev/null +++ b/pkg/cmd/testdata/output/list-all-deprecated.txt @@ -0,0 +1,10 @@ +Flag --all has been deprecated, this is now the default behavior in Helm v4 and this flag will be removed in a future release +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +drax default 1 2016-01-16 00:00:01 +0000 UTC uninstalling chickadee-1.0.0 0.0.1 +gamora default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 0.0.1 +groot default 1 2016-01-16 00:00:01 +0000 UTC uninstalled chickadee-1.0.0 0.0.1 +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 +thanos default 1 2016-01-16 00:00:01 +0000 UTC pending-install chickadee-1.0.0 0.0.1