Skip to content

Commit c4df0d1

Browse files
committed
cli/command/stack: remove deprecated RunList and options.List
These were deprecated in f0e5a0d and d16c560 and were only used internally. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b3cd9d4 commit c4df0d1

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

cli/command/stack/list.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import (
99
"github.com/docker/cli/cli/command"
1010
"github.com/docker/cli/cli/command/completion"
1111
"github.com/docker/cli/cli/command/stack/formatter"
12-
"github.com/docker/cli/cli/command/stack/options"
1312
"github.com/docker/cli/cli/command/stack/swarm"
1413
flagsHelper "github.com/docker/cli/cli/flags"
1514
"github.com/fvbommel/sortorder"
1615
"github.com/spf13/cobra"
1716
)
1817

19-
type listOptions = options.List
18+
// listOptions holds docker stack ls options
19+
type listOptions struct {
20+
format string
21+
}
2022

21-
func newListCommand(dockerCli command.Cli) *cobra.Command {
23+
func newListCommand(dockerCLI command.Cli) *cobra.Command {
2224
opts := listOptions{}
2325

2426
cmd := &cobra.Command{
@@ -27,23 +29,16 @@ func newListCommand(dockerCli command.Cli) *cobra.Command {
2729
Short: "List stacks",
2830
Args: cli.NoArgs,
2931
RunE: func(cmd *cobra.Command, args []string) error {
30-
return runList(cmd.Context(), dockerCli, opts)
32+
return runList(cmd.Context(), dockerCLI, opts)
3133
},
3234
ValidArgsFunction: completion.NoComplete,
3335
}
3436

3537
flags := cmd.Flags()
36-
flags.StringVar(&opts.Format, "format", "", flagsHelper.FormatHelp)
38+
flags.StringVar(&opts.format, "format", "", flagsHelper.FormatHelp)
3739
return cmd
3840
}
3941

40-
// RunList performs a stack list against the specified swarm cluster
41-
//
42-
// Deprecated: this function was for internal use and will be removed in the next release.
43-
func RunList(ctx context.Context, dockerCLI command.Cli, opts options.List) error {
44-
return runList(ctx, dockerCLI, opts)
45-
}
46-
4742
// runList performs a stack list against the specified swarm cluster
4843
func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error {
4944
stacks, err := swarm.GetStacks(ctx, dockerCLI.Client())
@@ -54,7 +49,7 @@ func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error
5449
}
5550

5651
func format(out io.Writer, opts listOptions, stacks []formatter.Stack) error {
57-
fmt := formatter.Format(opts.Format)
52+
fmt := formatter.Format(opts.format)
5853
if fmt == "" || fmt == formatter.TableFormatKey {
5954
fmt = formatter.SwarmStackTableFormat
6055
}

cli/command/stack/options/opts.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ type Config struct {
2323
SkipInterpolation bool
2424
}
2525

26-
// List holds docker stack ls options
27-
//
28-
// Deprecated: this type was for internal use and will be removed in the next release.
29-
type List struct {
30-
Format string
31-
AllNamespaces bool
32-
}
33-
3426
// PS holds docker stack ps options
3527
//
3628
// Deprecated: this type was for internal use and will be removed in the next release.

0 commit comments

Comments
 (0)