From 66eb27a487e02800278e43ac0ce8f6f7249c0a9c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 1 Mar 2025 01:34:23 +0100 Subject: [PATCH] cli/command: remove deprecated NotaryClient from CLI interface This method is a shallow wrapper around trust.GetNotaryRepository, but due to its signature resulted in the trust package, and notary dependencies to become a dependency of the CLI. Consequence of this was that cli-plugins, which need the cli/command package, would also get notary and its dependencies as a dependency. It is no longer used, and was deprecated in 9bc16bbde085c618d3bddfb633560ab9af83a58d. This patch removes the NotaryClient method from the interface Signed-off-by: Sebastiaan van Stijn --- cli/command/cli.go | 1 - cli/command/cli_deprecated.go | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/cli/command/cli.go b/cli/command/cli.go index 8b5780d6b7..fb3fb57934 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -56,7 +56,6 @@ type Cli interface { CurrentContext() string DockerEndpoint() docker.Endpoint TelemetryClient - DeprecatedNotaryClient DeprecatedManifestClient } diff --git a/cli/command/cli_deprecated.go b/cli/command/cli_deprecated.go index 15fac1a6e3..90137f2220 100644 --- a/cli/command/cli_deprecated.go +++ b/cli/command/cli_deprecated.go @@ -7,18 +7,9 @@ import ( "github.com/docker/cli/cli/config" manifeststore "github.com/docker/cli/cli/manifest/store" registryclient "github.com/docker/cli/cli/registry/client" - "github.com/docker/cli/cli/trust" "github.com/docker/docker/api/types/registry" - notaryclient "github.com/theupdateframework/notary/client" ) -type DeprecatedNotaryClient interface { - // NotaryClient provides a Notary Repository to interact with signed metadata for an image - // - // Deprecated: use [trust.GetNotaryRepository] instead. This method is no longer used and will be removed in the next release. - NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) -} - type DeprecatedManifestClient interface { // ManifestStore returns a store for local manifests // @@ -32,11 +23,6 @@ type DeprecatedManifestClient interface { RegistryClient(bool) registryclient.RegistryClient } -// NotaryClient provides a Notary Repository to interact with signed metadata for an image -func (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) { - return trust.GetNotaryRepository(cli.In(), cli.Out(), UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), actions...) -} - // ManifestStore returns a store for local manifests // // Deprecated: use [manifeststore.NewStore] instead. This method is no longer used and will be removed in the next release.