From 19b7dfa1cf44104836af4ab7988087ab6ef59530 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Aug 2025 10:15:33 +0200 Subject: [PATCH] deprecate cli/command/stack/swarm Functions and types in this package were exported as part of the "compose on kubernetes" feature, which was deprecated and removed. These functions are meant for internal use, and will be removed in the next release. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 036d3a6bab54fdffd9804ab2367fb9a14e62893b) Signed-off-by: Sebastiaan van Stijn --- cli/command/stack/swarm/deploy.go | 2 ++ cli/command/stack/swarm/list.go | 2 ++ cli/command/stack/swarm/ps.go | 2 ++ cli/command/stack/swarm/remove.go | 2 ++ cli/command/stack/swarm/services.go | 12 +++++++----- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cli/command/stack/swarm/deploy.go b/cli/command/stack/swarm/deploy.go index bfd71f5f65..cf3a52418f 100644 --- a/cli/command/stack/swarm/deploy.go +++ b/cli/command/stack/swarm/deploy.go @@ -23,6 +23,8 @@ const ( ) // RunDeploy is the swarm implementation of docker stack deploy +// +// Deprecated: this function was for internal use and will be removed in the next release. func RunDeploy(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *options.Deploy, cfg *composetypes.Config) error { if err := validateResolveImageFlag(opts); err != nil { return err diff --git a/cli/command/stack/swarm/list.go b/cli/command/stack/swarm/list.go index ec951d71d3..22b175a1ed 100644 --- a/cli/command/stack/swarm/list.go +++ b/cli/command/stack/swarm/list.go @@ -11,6 +11,8 @@ import ( ) // GetStacks lists the swarm stacks. +// +// Deprecated: this function was for internal use and will be removed in the next release. func GetStacks(ctx context.Context, apiClient client.ServiceAPIClient) ([]*formatter.Stack, error) { services, err := apiClient.ServiceList( ctx, diff --git a/cli/command/stack/swarm/ps.go b/cli/command/stack/swarm/ps.go index e892fc94c9..fc16b7eb72 100644 --- a/cli/command/stack/swarm/ps.go +++ b/cli/command/stack/swarm/ps.go @@ -12,6 +12,8 @@ import ( ) // RunPS is the swarm implementation of docker stack ps +// +// Deprecated: this function was for internal use and will be removed in the next release. func RunPS(ctx context.Context, dockerCLI command.Cli, opts options.PS) error { filter := getStackFilterFromOpt(opts.Namespace, opts.Filter) diff --git a/cli/command/stack/swarm/remove.go b/cli/command/stack/swarm/remove.go index cd426d5111..42812262ab 100644 --- a/cli/command/stack/swarm/remove.go +++ b/cli/command/stack/swarm/remove.go @@ -15,6 +15,8 @@ import ( ) // RunRemove is the swarm implementation of docker stack remove +// +// Deprecated: this function was for internal use and will be removed in the next release. func RunRemove(ctx context.Context, dockerCli command.Cli, opts options.Remove) error { apiClient := dockerCli.Client() diff --git a/cli/command/stack/swarm/services.go b/cli/command/stack/swarm/services.go index e75d3ccf8c..4a2eed34f5 100644 --- a/cli/command/stack/swarm/services.go +++ b/cli/command/stack/swarm/services.go @@ -10,10 +10,12 @@ import ( ) // GetServices is the swarm implementation of listing stack services -func GetServices(ctx context.Context, dockerCli command.Cli, opts options.Services) ([]swarm.Service, error) { +// +// Deprecated: this function was for internal use and will be removed in the next release. +func GetServices(ctx context.Context, dockerCLI command.Cli, opts options.Services) ([]swarm.Service, error) { var ( - err error - client = dockerCli.Client() + err error + apiClient = dockerCLI.Client() ) listOpts := swarm.ServiceListOptions{ @@ -25,7 +27,7 @@ func GetServices(ctx context.Context, dockerCli command.Cli, opts options.Servic Status: !opts.Quiet, } - services, err := client.ServiceList(ctx, listOpts) + services, err := apiClient.ServiceList(ctx, listOpts) if err != nil { return nil, err } @@ -43,7 +45,7 @@ func GetServices(ctx context.Context, dockerCli command.Cli, opts options.Servic // situations where the client uses the "default" version. To account for // these situations, we do a quick check for services that do not have // a ServiceStatus set, and perform a lookup for those. - services, err = service.AppendServiceStatus(ctx, client, services) + services, err = service.AppendServiceStatus(ctx, apiClient, services) if err != nil { return nil, err }