diff --git a/cli/command/manifest/annotate.go b/cli/command/manifest/annotate.go index a99714785..e5f49fc1c 100644 --- a/cli/command/manifest/annotate.go +++ b/cli/command/manifest/annotate.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/manifest/store" - registryclient "github.com/docker/cli/cli/registry/client" + "github.com/docker/cli/internal/registryclient" "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/cobra" diff --git a/cli/command/manifest/client_test.go b/cli/command/manifest/client_test.go index 497251c70..16b7912ab 100644 --- a/cli/command/manifest/client_test.go +++ b/cli/command/manifest/client_test.go @@ -5,7 +5,7 @@ import ( "github.com/distribution/reference" manifesttypes "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/cli/registry/client" + "github.com/docker/cli/internal/registryclient" "github.com/docker/distribution" "github.com/opencontainers/go-digest" ) @@ -45,4 +45,4 @@ func (c *fakeRegistryClient) PutManifest(ctx context.Context, ref reference.Name return digest.Digest(""), nil } -var _ client.RegistryClient = &fakeRegistryClient{} +var _ registryclient.RegistryClient = &fakeRegistryClient{} diff --git a/cli/command/manifest/push.go b/cli/command/manifest/push.go index 63174c068..09ce1ee26 100644 --- a/cli/command/manifest/push.go +++ b/cli/command/manifest/push.go @@ -10,7 +10,7 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/manifest/types" - registryclient "github.com/docker/cli/cli/registry/client" + "github.com/docker/cli/internal/registryclient" "github.com/docker/distribution" "github.com/docker/distribution/manifest/manifestlist" "github.com/docker/distribution/manifest/ocischema" diff --git a/cli/registry/client/client_deprecated.go b/cli/registry/client/client_deprecated.go new file mode 100644 index 000000000..b3ffde574 --- /dev/null +++ b/cli/registry/client/client_deprecated.go @@ -0,0 +1,21 @@ +package client // Deprecated: this package was only used internally and will be removed in the next release. + +import "github.com/docker/cli/internal/registryclient" + +// RegistryClient is a client used to communicate with a Docker distribution +// registry. +// +// Deprecated: this interface was only used internally and will be removed in the next release. +type RegistryClient = registryclient.RegistryClient + +// NewRegistryClient returns a new RegistryClient with a resolver +// +// Deprecated: this function was only used internally and will be removed in the next release. +func NewRegistryClient(resolver registryclient.AuthConfigResolver, userAgent string, insecure bool) registryclient.RegistryClient { + return registryclient.NewRegistryClient(resolver, userAgent, insecure) +} + +// AuthConfigResolver returns Auth Configuration for an index +// +// Deprecated: this type was only used internally and will be removed in the next release. +type AuthConfigResolver = registryclient.AuthConfigResolver diff --git a/cli/registry/client/client.go b/internal/registryclient/client.go similarity index 99% rename from cli/registry/client/client.go rename to internal/registryclient/client.go index d925ad9a3..f848dea5f 100644 --- a/cli/registry/client/client.go +++ b/internal/registryclient/client.go @@ -1,4 +1,4 @@ -package client +package registryclient import ( "context" diff --git a/cli/registry/client/endpoint.go b/internal/registryclient/endpoint.go similarity index 99% rename from cli/registry/client/endpoint.go rename to internal/registryclient/endpoint.go index 412dbe866..85fd67813 100644 --- a/cli/registry/client/endpoint.go +++ b/internal/registryclient/endpoint.go @@ -1,4 +1,4 @@ -package client +package registryclient import ( "context" diff --git a/cli/registry/client/fetcher.go b/internal/registryclient/fetcher.go similarity index 99% rename from cli/registry/client/fetcher.go rename to internal/registryclient/fetcher.go index 378202e63..325cbf6e0 100644 --- a/cli/registry/client/fetcher.go +++ b/internal/registryclient/fetcher.go @@ -1,4 +1,4 @@ -package client +package registryclient import ( "context" diff --git a/internal/test/cli.go b/internal/test/cli.go index b7c9228f4..136b6c48c 100644 --- a/internal/test/cli.go +++ b/internal/test/cli.go @@ -11,9 +11,9 @@ import ( "github.com/docker/cli/cli/context/docker" "github.com/docker/cli/cli/context/store" 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/trust" + "github.com/docker/cli/internal/registryclient" "github.com/moby/moby/client" notaryclient "github.com/theupdateframework/notary/client" )