cli/command/stack: remove deprecated RunDeploy, RunPS, RunRemove, GetServices

These were deprecated in f08252c10a, which
is part of the v24.0 release, so we can remove these on master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-05-09 22:32:21 +02:00
parent bc3f905a2a
commit d3ac801275
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 0 additions and 33 deletions

View File

@ -6,9 +6,7 @@ import (
"github.com/docker/cli/cli/command/stack/loader" "github.com/docker/cli/cli/command/stack/loader"
"github.com/docker/cli/cli/command/stack/options" "github.com/docker/cli/cli/command/stack/options"
"github.com/docker/cli/cli/command/stack/swarm" "github.com/docker/cli/cli/command/stack/swarm"
composetypes "github.com/docker/cli/cli/compose/types"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag"
) )
func newDeployCommand(dockerCli command.Cli) *cobra.Command { 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"}) flags.SetAnnotation("resolve-image", "version", []string{"1.30"})
return cmd 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)
}

View File

@ -8,7 +8,6 @@ import (
flagsHelper "github.com/docker/cli/cli/flags" flagsHelper "github.com/docker/cli/cli/flags"
cliopts "github.com/docker/cli/opts" cliopts "github.com/docker/cli/opts"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag"
) )
func newPsCommand(dockerCli command.Cli) *cobra.Command { 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) flags.StringVar(&opts.Format, "format", "", flagsHelper.FormatHelp)
return cmd 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)
}

View File

@ -6,7 +6,6 @@ import (
"github.com/docker/cli/cli/command/stack/options" "github.com/docker/cli/cli/command/stack/options"
"github.com/docker/cli/cli/command/stack/swarm" "github.com/docker/cli/cli/command/stack/swarm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag"
) )
func newRemoveCommand(dockerCli command.Cli) *cobra.Command { func newRemoveCommand(dockerCli command.Cli) *cobra.Command {
@ -30,10 +29,3 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command {
} }
return cmd 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)
}

View File

@ -15,7 +15,6 @@ import (
swarmtypes "github.com/docker/docker/api/types/swarm" swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/fvbommel/sortorder" "github.com/fvbommel/sortorder"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag"
) )
func newServicesCommand(dockerCli command.Cli) *cobra.Command { 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) 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 { func formatWrite(dockerCli command.Cli, services []swarmtypes.Service, opts options.Services) error {
// if no services in the stack, print message and exit 0 // if no services in the stack, print message and exit 0
if len(services) == 0 { if len(services) == 0 {