diff --git a/cli/command/cli.go b/cli/command/cli.go index 8b5780d6b751..2a78c5079cb2 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -56,8 +56,6 @@ type Cli interface { CurrentContext() string DockerEndpoint() docker.Endpoint TelemetryClient - DeprecatedNotaryClient - 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 15fac1a6e327..000000000000 --- a/cli/command/cli_deprecated.go +++ /dev/null @@ -1,56 +0,0 @@ -package command - -import ( - "context" - "path/filepath" - - "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 - // - // Deprecated: use [manifeststore.NewStore] instead. This method is no longer used and will be removed in the next release. - ManifestStore() manifeststore.Store - - // 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 -} - -// 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. -func (*DockerCli) ManifestStore() manifeststore.Store { - return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests")) -} - -// 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) -} diff --git a/cli/command/image/trust.go b/cli/command/image/trust.go index b4a6d84a0093..7e2e46b2eec0 100644 --- a/cli/command/image/trust.go +++ b/cli/command/image/trust.go @@ -41,27 +41,6 @@ func newNotaryClient(cli command.Streams, imgRefAndAuth trust.ImageRefAndAuth) ( return trust.GetNotaryRepository(cli.In(), cli.Out(), command.UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), "pull") } -// TrustedPush handles content trust pushing of an image. -// -// Deprecated: this function was only used internally and will be removed in the next release. -func TrustedPush(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig registrytypes.AuthConfig, options image.PushOptions) error { - responseBody, err := cli.Client().ImagePush(ctx, reference.FamiliarString(ref), options) - if err != nil { - return err - } - - defer responseBody.Close() - - return trust.PushTrustedReference(ctx, cli, repoInfo, ref, authConfig, responseBody, command.UserAgent()) -} - -// PushTrustedReference pushes a canonical reference to the trust server. -// -// Deprecated: use [trust.PushTrustedReference] instead. this function was only used internally and will be removed in the next release. -func PushTrustedReference(ctx context.Context, ioStreams command.Streams, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig registrytypes.AuthConfig, in io.Reader) error { - return pushTrustedReference(ctx, ioStreams, repoInfo, ref, authConfig, in) -} - // pushTrustedReference pushes a canonical reference to the trust server. func pushTrustedReference(ctx context.Context, ioStreams command.Streams, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig registrytypes.AuthConfig, in io.Reader) error { return trust.PushTrustedReference(ctx, ioStreams, repoInfo, ref, authConfig, in, command.UserAgent()) @@ -229,15 +208,6 @@ func convertTarget(t client.Target) (target, error) { }, nil } -// TagTrusted tags a trusted ref. It is a shallow wrapper around APIClient.ImageTag -// that updates the given image references to their familiar format for tagging -// and printing. -// -// Deprecated: this function was only used internally, and will be removed in the next release. -func TagTrusted(ctx context.Context, cli command.Cli, trustedRef reference.Canonical, ref reference.NamedTagged) error { - return trust.TagTrusted(ctx, cli.Client(), cli.Err(), trustedRef, ref) -} - // AuthResolver returns an auth resolver function from a command.Cli func AuthResolver(cli command.Cli) func(ctx context.Context, index *registrytypes.IndexInfo) registrytypes.AuthConfig { return func(ctx context.Context, index *registrytypes.IndexInfo) registrytypes.AuthConfig {