From c4df0d17bb9f7a35063180e50a01577c7ff281b2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Aug 2025 14:08:03 +0200 Subject: [PATCH] cli/command/stack: remove deprecated RunList and options.List These were deprecated in f0e5a0d6545399477660087e2db69ebbf831666d and d16c56066427be5e988c197d40c93475446bcdda and were only used internally. Signed-off-by: Sebastiaan van Stijn --- cli/command/stack/list.go | 21 ++++++++------------- cli/command/stack/options/opts.go | 8 -------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/cli/command/stack/list.go b/cli/command/stack/list.go index 622d18165b..3306a51b80 100644 --- a/cli/command/stack/list.go +++ b/cli/command/stack/list.go @@ -9,16 +9,18 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" "github.com/docker/cli/cli/command/stack/formatter" - "github.com/docker/cli/cli/command/stack/options" "github.com/docker/cli/cli/command/stack/swarm" flagsHelper "github.com/docker/cli/cli/flags" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" ) -type listOptions = options.List +// listOptions holds docker stack ls options +type listOptions struct { + format string +} -func newListCommand(dockerCli command.Cli) *cobra.Command { +func newListCommand(dockerCLI command.Cli) *cobra.Command { opts := listOptions{} cmd := &cobra.Command{ @@ -27,23 +29,16 @@ func newListCommand(dockerCli command.Cli) *cobra.Command { Short: "List stacks", Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { - return runList(cmd.Context(), dockerCli, opts) + return runList(cmd.Context(), dockerCLI, opts) }, ValidArgsFunction: completion.NoComplete, } flags := cmd.Flags() - flags.StringVar(&opts.Format, "format", "", flagsHelper.FormatHelp) + flags.StringVar(&opts.format, "format", "", flagsHelper.FormatHelp) return cmd } -// RunList performs a stack list against the specified swarm cluster -// -// Deprecated: this function was for internal use and will be removed in the next release. -func RunList(ctx context.Context, dockerCLI command.Cli, opts options.List) error { - return runList(ctx, dockerCLI, opts) -} - // runList performs a stack list against the specified swarm cluster func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error { stacks, err := swarm.GetStacks(ctx, dockerCLI.Client()) @@ -54,7 +49,7 @@ func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error } func format(out io.Writer, opts listOptions, stacks []formatter.Stack) error { - fmt := formatter.Format(opts.Format) + fmt := formatter.Format(opts.format) if fmt == "" || fmt == formatter.TableFormatKey { fmt = formatter.SwarmStackTableFormat } diff --git a/cli/command/stack/options/opts.go b/cli/command/stack/options/opts.go index bd239e892f..36a01f4e02 100644 --- a/cli/command/stack/options/opts.go +++ b/cli/command/stack/options/opts.go @@ -23,14 +23,6 @@ type Config struct { SkipInterpolation bool } -// List holds docker stack ls options -// -// Deprecated: this type was for internal use and will be removed in the next release. -type List struct { - Format string - AllNamespaces bool -} - // PS holds docker stack ps options // // Deprecated: this type was for internal use and will be removed in the next release.