Skip to content

Commit e32d5d5

Browse files
committed
cli/command: deprecate Cli.ManifestStore
This method is a shallow wrapper around manifeststore.NewStore, 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 in our code, which constructs the client in packages that need it, so we can deprecate this method. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 985b58e commit e32d5d5

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

cli/command/cli.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"fmt"
99
"io"
1010
"os"
11-
"path/filepath"
1211
"runtime"
1312
"strconv"
1413
"strings"
@@ -22,7 +21,6 @@ import (
2221
"github.com/docker/cli/cli/context/store"
2322
"github.com/docker/cli/cli/debug"
2423
cliflags "github.com/docker/cli/cli/flags"
25-
manifeststore "github.com/docker/cli/cli/manifest/store"
2624
registryclient "github.com/docker/cli/cli/registry/client"
2725
"github.com/docker/cli/cli/streams"
2826
"github.com/docker/cli/cli/version"
@@ -56,7 +54,6 @@ type Cli interface {
5654
ServerInfo() ServerInfo
5755
DefaultVersion() string
5856
CurrentVersion() string
59-
ManifestStore() manifeststore.Store
6057
RegistryClient(bool) registryclient.RegistryClient
6158
ContentTrustEnabled() bool
6259
BuildKitEnabled() (bool, error)
@@ -65,6 +62,7 @@ type Cli interface {
6562
DockerEndpoint() docker.Endpoint
6663
TelemetryClient
6764
DeprecatedNotaryClient
65+
DeprecatedManifestClient
6866
}
6967

7068
// DockerCli is an instance the docker command line client.
@@ -229,12 +227,6 @@ func (cli *DockerCli) HooksEnabled() bool {
229227
return false
230228
}
231229

232-
// ManifestStore returns a store for local manifests
233-
func (*DockerCli) ManifestStore() manifeststore.Store {
234-
// TODO: support override default location from config file
235-
return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests"))
236-
}
237-
238230
// RegistryClient returns a client for communicating with a Docker distribution
239231
// registry
240232
func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient {

cli/command/cli_deprecated.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package command
22

33
import (
4+
"path/filepath"
5+
6+
"github.com/docker/cli/cli/config"
7+
manifeststore "github.com/docker/cli/cli/manifest/store"
48
"github.com/docker/cli/cli/trust"
59
notaryclient "github.com/theupdateframework/notary/client"
610
)
@@ -12,7 +16,21 @@ type DeprecatedNotaryClient interface {
1216
NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)
1317
}
1418

19+
type DeprecatedManifestClient interface {
20+
// ManifestStore returns a store for local manifests
21+
//
22+
// Deprecated: use [manifeststore.NewStore] instead. This method is no longer used and will be removed in the next release.
23+
ManifestStore() manifeststore.Store
24+
}
25+
1526
// NotaryClient provides a Notary Repository to interact with signed metadata for an image
1627
func (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) {
1728
return trust.GetNotaryRepository(cli.In(), cli.Out(), UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), actions...)
1829
}
30+
31+
// ManifestStore returns a store for local manifests
32+
//
33+
// Deprecated: use [manifeststore.NewStore] instead. This method is no longer used and will be removed in the next release.
34+
func (*DockerCli) ManifestStore() manifeststore.Store {
35+
return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests"))
36+
}

0 commit comments

Comments
 (0)