From 5ea072d9369b933adeecb701ef60319e76bf9a02 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 1 Mar 2025 02:45:42 +0100 Subject: [PATCH] cli/command: remove deprecated RegistryClient from CLI interface This method was a shallow wrapper around registryclient.NewRegistryClient but due to its signature resulted in various dependencies becoming a dependency of the "command" package. Consequence of this was that cli-plugins, which need the cli/command package, would also get those dependencies. It is no longer used, and was deprecated in 8ad07217dc92fa81806d4eb64a4eb04cf5c99b15. This patch removes the RegistryClient method from the interface Signed-off-by: Sebastiaan van Stijn --- cli/command/cli.go | 1 - cli/command/cli_deprecated.go | 27 --------------------------- 2 files changed, 28 deletions(-) delete mode 100644 cli/command/cli_deprecated.go diff --git a/cli/command/cli.go b/cli/command/cli.go index fb3fb57934..2a78c5079c 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -56,7 +56,6 @@ type Cli interface { CurrentContext() string DockerEndpoint() docker.Endpoint TelemetryClient - DeprecatedManifestClient } // DockerCli is an instance the docker command line client. diff --git a/cli/command/cli_deprecated.go b/cli/command/cli_deprecated.go deleted file mode 100644 index 9b052db5d4..0000000000 --- a/cli/command/cli_deprecated.go +++ /dev/null @@ -1,27 +0,0 @@ -package command - -import ( - "context" - - registryclient "github.com/docker/cli/cli/registry/client" - "github.com/docker/docker/api/types/registry" -) - -type DeprecatedManifestClient interface { - // RegistryClient returns a client for communicating with a Docker distribution - // registry. - // - // Deprecated: use [registryclient.NewRegistryClient]. This method is no longer used and will be removed in the next release. - RegistryClient(bool) registryclient.RegistryClient -} - -// RegistryClient returns a client for communicating with a Docker distribution -// registry -// -// Deprecated: use [registryclient.NewRegistryClient]. This method is no longer used and will be removed in the next release. -func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient { - resolver := func(ctx context.Context, index *registry.IndexInfo) registry.AuthConfig { - return ResolveAuthConfig(cli.ConfigFile(), index) - } - return registryclient.NewRegistryClient(resolver, UserAgent(), allowInsecure) -}