diff --git a/cli/command/cli.go b/cli/command/cli.go index dfb4fba69a..7d15602156 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -8,7 +8,6 @@ import ( "fmt" "io" "os" - "path/filepath" "runtime" "strconv" "strings" @@ -22,7 +21,6 @@ import ( "github.com/docker/cli/cli/context/store" "github.com/docker/cli/cli/debug" cliflags "github.com/docker/cli/cli/flags" - manifeststore "github.com/docker/cli/cli/manifest/store" registryclient "github.com/docker/cli/cli/registry/client" "github.com/docker/cli/cli/streams" "github.com/docker/cli/cli/version" @@ -56,7 +54,6 @@ type Cli interface { ServerInfo() ServerInfo DefaultVersion() string CurrentVersion() string - ManifestStore() manifeststore.Store RegistryClient(bool) registryclient.RegistryClient ContentTrustEnabled() bool BuildKitEnabled() (bool, error) @@ -65,6 +62,7 @@ type Cli interface { DockerEndpoint() docker.Endpoint TelemetryClient DeprecatedNotaryClient + DeprecatedManifestClient } // DockerCli is an instance the docker command line client. @@ -229,12 +227,6 @@ func (cli *DockerCli) HooksEnabled() bool { return false } -// ManifestStore returns a store for local manifests -func (*DockerCli) ManifestStore() manifeststore.Store { - // TODO: support override default location from config file - return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests")) -} - // RegistryClient returns a client for communicating with a Docker distribution // registry func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient { diff --git a/cli/command/cli_deprecated.go b/cli/command/cli_deprecated.go index d179f42f22..d6e38a607a 100644 --- a/cli/command/cli_deprecated.go +++ b/cli/command/cli_deprecated.go @@ -1,6 +1,10 @@ package command import ( + "path/filepath" + + "github.com/docker/cli/cli/config" + manifeststore "github.com/docker/cli/cli/manifest/store" "github.com/docker/cli/cli/trust" notaryclient "github.com/theupdateframework/notary/client" ) @@ -12,7 +16,21 @@ type DeprecatedNotaryClient interface { 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 +} + // 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")) +}