From 678c3362302dd82258141109794f225aced3af06 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Wed, 17 Sep 2025 06:42:19 -0600 Subject: [PATCH] chore: clean up for comments Signed-off-by: Terry Howe --- pkg/action/list.go | 2 +- pkg/action/list_test.go | 1 - pkg/cmd/list.go | 18 +++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pkg/action/list.go b/pkg/action/list.go index b2128c8b7..5b9341dbd 100644 --- a/pkg/action/list.go +++ b/pkg/action/list.go @@ -315,7 +315,7 @@ func (l *List) SetStateMask() { state |= ListSuperseded } - // Apply a default - now defaults to ListAll instead of just deployed and failed + // Apply a default if state == 0 { state = ListAll } diff --git a/pkg/action/list_test.go b/pkg/action/list_test.go index 0fddfd98d..68f1f6214 100644 --- a/pkg/action/list_test.go +++ b/pkg/action/list_test.go @@ -174,7 +174,6 @@ func TestList_StateMask(t *testing.T) { err = lister.cfg.Releases.Update(one) is.NoError(err) - // With the new default (ListAll), we should see all 3 releases by default res, err := lister.Run() is.NoError(err) is.Len(res, 3) diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index fd424427b..70264836b 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -36,10 +36,10 @@ import ( var listHelp = ` This command lists all of the releases for a specified namespace (uses current namespace context if namespace not specified). -By default, it lists all releases in any status including deployed, failed, -pending-upgrade, pending-install, pending-rollback, uninstalled, uninstalling, +By default, it lists all releases in any status including deployed, failed, +pending-upgrade, pending-install, pending-rollback, uninstalled, uninstalling, superseded, and unknown. Individual status filters like '--deployed', '--failed', -'--pending', '--uninstalled', '--superseded', and '--uninstalling' can be used +'--pending', '--uninstalled', '--superseded', and '--uninstalling' can be used to show only releases in specific states. Such flags can be combined: '--deployed --failed'. @@ -120,12 +120,12 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { f.StringVar(&client.TimeFormat, "time-format", "", `format time using golang time formatter. Example: --time-format "2006-01-02 15:04:05Z0700"`) f.BoolVarP(&client.ByDate, "date", "d", false, "sort by release date") f.BoolVarP(&client.SortReverse, "reverse", "r", false, "reverse the sort order") - f.BoolVar(&client.Uninstalled, "uninstalled", false, "show only uninstalled releases (if 'helm uninstall --keep-history' was used)") - f.BoolVar(&client.Superseded, "superseded", false, "show only superseded releases") - f.BoolVar(&client.Uninstalling, "uninstalling", false, "show only releases that are currently being uninstalled") - f.BoolVar(&client.Deployed, "deployed", false, "show only deployed releases") - f.BoolVar(&client.Failed, "failed", false, "show only failed releases") - f.BoolVar(&client.Pending, "pending", false, "show only pending releases") + f.BoolVar(&client.Uninstalled, "uninstalled", false, "show uninstalled releases (if 'helm uninstall --keep-history' was used)") + f.BoolVar(&client.Superseded, "superseded", false, "show superseded releases") + f.BoolVar(&client.Uninstalling, "uninstalling", false, "show releases that are currently being uninstalled") + f.BoolVar(&client.Deployed, "deployed", false, "show deployed releases") + f.BoolVar(&client.Failed, "failed", false, "show failed releases") + f.BoolVar(&client.Pending, "pending", false, "show pending releases") f.BoolVarP(&client.AllNamespaces, "all-namespaces", "A", false, "list releases across all namespaces") f.IntVarP(&client.Limit, "max", "m", 256, "maximum number of releases to fetch") f.IntVar(&client.Offset, "offset", 0, "next release index in the list, used to offset from start value")