From d3ac80127525c1edd4aee000b057c21b9ea43cb9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 9 May 2023 22:32:21 +0200 Subject: [PATCH] cli/command/stack: remove deprecated RunDeploy, RunPS, RunRemove, GetServices These were deprecated in f08252c10a16beac0ad40348118a96fa6b447f19, which is part of the v24.0 release, so we can remove these on master. Signed-off-by: Sebastiaan van Stijn --- cli/command/stack/deploy.go | 9 --------- cli/command/stack/ps.go | 8 -------- cli/command/stack/remove.go | 8 -------- cli/command/stack/services.go | 8 -------- 4 files changed, 33 deletions(-) diff --git a/cli/command/stack/deploy.go b/cli/command/stack/deploy.go index 8b977ad0a1..83447ff1e4 100644 --- a/cli/command/stack/deploy.go +++ b/cli/command/stack/deploy.go @@ -6,9 +6,7 @@ import ( "github.com/docker/cli/cli/command/stack/loader" "github.com/docker/cli/cli/command/stack/options" "github.com/docker/cli/cli/command/stack/swarm" - composetypes "github.com/docker/cli/cli/compose/types" "github.com/spf13/cobra" - "github.com/spf13/pflag" ) func newDeployCommand(dockerCli command.Cli) *cobra.Command { @@ -46,10 +44,3 @@ func newDeployCommand(dockerCli command.Cli) *cobra.Command { flags.SetAnnotation("resolve-image", "version", []string{"1.30"}) return cmd } - -// RunDeploy performs a stack deploy against the specified swarm cluster. -// -// Deprecated: use [swarm.RunDeploy] instead. -func RunDeploy(dockerCli command.Cli, _ *pflag.FlagSet, config *composetypes.Config, opts options.Deploy) error { - return swarm.RunDeploy(dockerCli, opts, config) -} diff --git a/cli/command/stack/ps.go b/cli/command/stack/ps.go index f962b895a7..570da21cd8 100644 --- a/cli/command/stack/ps.go +++ b/cli/command/stack/ps.go @@ -8,7 +8,6 @@ import ( flagsHelper "github.com/docker/cli/cli/flags" cliopts "github.com/docker/cli/opts" "github.com/spf13/cobra" - "github.com/spf13/pflag" ) func newPsCommand(dockerCli command.Cli) *cobra.Command { @@ -37,10 +36,3 @@ func newPsCommand(dockerCli command.Cli) *cobra.Command { flags.StringVar(&opts.Format, "format", "", flagsHelper.FormatHelp) return cmd } - -// RunPs performs a stack ps against the specified swarm cluster. -// -// Deprecated: use [swarm.RunPS] instead. -func RunPs(dockerCli command.Cli, _ *pflag.FlagSet, opts options.PS) error { - return swarm.RunPS(dockerCli, opts) -} diff --git a/cli/command/stack/remove.go b/cli/command/stack/remove.go index 34827666d0..7981b6fe88 100644 --- a/cli/command/stack/remove.go +++ b/cli/command/stack/remove.go @@ -6,7 +6,6 @@ import ( "github.com/docker/cli/cli/command/stack/options" "github.com/docker/cli/cli/command/stack/swarm" "github.com/spf13/cobra" - "github.com/spf13/pflag" ) func newRemoveCommand(dockerCli command.Cli) *cobra.Command { @@ -30,10 +29,3 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command { } return cmd } - -// RunRemove performs a stack remove against the specified swarm cluster. -// -// Deprecated: use [swarm.RunRemove] instead. -func RunRemove(dockerCli command.Cli, _ *pflag.FlagSet, opts options.Remove) error { - return swarm.RunRemove(dockerCli, opts) -} diff --git a/cli/command/stack/services.go b/cli/command/stack/services.go index ef1947614a..fdfd5eece3 100644 --- a/cli/command/stack/services.go +++ b/cli/command/stack/services.go @@ -15,7 +15,6 @@ import ( swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" - "github.com/spf13/pflag" ) func newServicesCommand(dockerCli command.Cli) *cobra.Command { @@ -52,13 +51,6 @@ func RunServices(dockerCli command.Cli, opts options.Services) error { return formatWrite(dockerCli, services, opts) } -// GetServices returns the services for the specified swarm cluster. -// -// Deprecated: use [swarm.GetServices] instead. -func GetServices(dockerCli command.Cli, _ *pflag.FlagSet, opts options.Services) ([]swarmtypes.Service, error) { - return swarm.GetServices(dockerCli, opts) -} - func formatWrite(dockerCli command.Cli, services []swarmtypes.Service, opts options.Services) error { // if no services in the stack, print message and exit 0 if len(services) == 0 {