From 250e4a564cc88ff508c13bfc73da21e6fdef7008 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 25 Aug 2025 19:24:11 +0200 Subject: [PATCH] cli/command/config: remove deprecated types and functions These were deprecated in a5f4ba08d941df6f3eb768683cbe412ef12487e3 and only used internally. This removes the deprecated types and functions: - `RunConfigCreate` and `CreateOptions` - `RunConfigInspect` and `InspectOptions` - `RunConfigList` and `ListOptions` - `RunConfigRemove` and `RemoveOptions` Signed-off-by: Sebastiaan van Stijn --- cli/command/config/create.go | 22 ---------------------- cli/command/config/inspect.go | 20 -------------------- cli/command/config/ls.go | 20 -------------------- cli/command/config/remove.go | 14 -------------- 4 files changed, 76 deletions(-) diff --git a/cli/command/config/create.go b/cli/command/config/create.go index ab4dcbd199..c6f66a30f6 100644 --- a/cli/command/config/create.go +++ b/cli/command/config/create.go @@ -15,16 +15,6 @@ import ( "github.com/spf13/cobra" ) -// CreateOptions specifies some options that are used when creating a config. -// -// Deprecated: this type was for internal use and will be removed in the next release. -type CreateOptions struct { - Name string - TemplateDriver string - File string - Labels opts.ListOpts -} - // createOptions specifies some options that are used when creating a config. type createOptions struct { name string @@ -57,18 +47,6 @@ func newConfigCreateCommand(dockerCLI command.Cli) *cobra.Command { return cmd } -// RunConfigCreate creates a config with the given options. -// -// Deprecated: this function was for internal use and will be removed in the next release. -func RunConfigCreate(ctx context.Context, dockerCLI command.Cli, options CreateOptions) error { - return runCreate(ctx, dockerCLI, createOptions{ - name: options.Name, - templateDriver: options.TemplateDriver, - file: options.File, - labels: options.Labels, - }) -} - // runCreate creates a config with the given options. func runCreate(ctx context.Context, dockerCLI command.Cli, options createOptions) error { apiClient := dockerCLI.Client() diff --git a/cli/command/config/inspect.go b/cli/command/config/inspect.go index 1b6ab16bc0..cbfe2dfcd1 100644 --- a/cli/command/config/inspect.go +++ b/cli/command/config/inspect.go @@ -15,15 +15,6 @@ import ( "github.com/spf13/cobra" ) -// InspectOptions contains options for the docker config inspect command. -// -// Deprecated: this type was for internal use and will be removed in the next release. -type InspectOptions struct { - Names []string - Format string - Pretty bool -} - // inspectOptions contains options for the docker config inspect command. type inspectOptions struct { names []string @@ -51,17 +42,6 @@ func newConfigInspectCommand(dockerCLI command.Cli) *cobra.Command { return cmd } -// RunConfigInspect inspects the given Swarm config. -// -// Deprecated: this function was for internal use and will be removed in the next release. -func RunConfigInspect(ctx context.Context, dockerCLI command.Cli, opts InspectOptions) error { - return runInspect(ctx, dockerCLI, inspectOptions{ - names: opts.Names, - format: opts.Format, - pretty: opts.Pretty, - }) -} - // runInspect inspects the given Swarm config. func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error { apiClient := dockerCLI.Client() diff --git a/cli/command/config/ls.go b/cli/command/config/ls.go index 8b89477260..07db2f73f1 100644 --- a/cli/command/config/ls.go +++ b/cli/command/config/ls.go @@ -15,15 +15,6 @@ import ( "github.com/spf13/cobra" ) -// ListOptions contains options for the docker config ls command. -// -// Deprecated: this type was for internal use and will be removed in the next release. -type ListOptions struct { - Quiet bool - Format string - Filter opts.FilterOpt -} - // listOptions contains options for the docker config ls command. type listOptions struct { quiet bool @@ -53,17 +44,6 @@ func newConfigListCommand(dockerCLI command.Cli) *cobra.Command { return cmd } -// RunConfigList lists Swarm configs. -// -// Deprecated: this function was for internal use and will be removed in the next release. -func RunConfigList(ctx context.Context, dockerCLI command.Cli, options ListOptions) error { - return runList(ctx, dockerCLI, listOptions{ - quiet: options.Quiet, - format: options.Format, - filter: options.Filter, - }) -} - // runList lists Swarm configs. func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) error { apiClient := dockerCLI.Client() diff --git a/cli/command/config/remove.go b/cli/command/config/remove.go index e74a272247..9f1e9253d2 100644 --- a/cli/command/config/remove.go +++ b/cli/command/config/remove.go @@ -10,13 +10,6 @@ import ( "github.com/spf13/cobra" ) -// RemoveOptions contains options for the docker config rm command. -// -// Deprecated: this type was for internal use and will be removed in the next release. -type RemoveOptions struct { - Names []string -} - func newConfigRemoveCommand(dockerCLI command.Cli) *cobra.Command { return &cobra.Command{ Use: "rm CONFIG [CONFIG...]", @@ -32,13 +25,6 @@ func newConfigRemoveCommand(dockerCLI command.Cli) *cobra.Command { } } -// RunConfigRemove removes the given Swarm configs. -// -// Deprecated: this function was for internal use and will be removed in the next release. -func RunConfigRemove(ctx context.Context, dockerCLI command.Cli, opts RemoveOptions) error { - return runRemove(ctx, dockerCLI, opts.Names) -} - // runRemove removes the given Swarm configs. func runRemove(ctx context.Context, dockerCLI command.Cli, names []string) error { apiClient := dockerCLI.Client()