use consistent alias for api/types/registry

Not a fan of aliases, but unfortunately they're sometimes needed. We import both
docker/docker/registry and docker/registry and api/types/registry, so I looked
for which one to continue using an alias, and this was the one "least" used,
and which already used this alias everywhere, except for two places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-03-04 14:38:45 +01:00
parent b7e4f3daa6
commit e40529aa3b
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import (
"strings"
"github.com/docker/cli/cli/command/formatter"
registry "github.com/docker/docker/api/types/registry"
registrytypes "github.com/docker/docker/api/types/registry"
)
const (
@ -28,7 +28,7 @@ func NewSearchFormat(source string) formatter.Format {
}
// SearchWrite writes the context
func SearchWrite(ctx formatter.Context, results []registry.SearchResult) error {
func SearchWrite(ctx formatter.Context, results []registrytypes.SearchResult) error {
render := func(format func(subContext formatter.SubContext) error) error {
for _, result := range results {
searchCtx := &searchContext{trunc: ctx.Trunc, s: result}
@ -53,7 +53,7 @@ type searchContext struct {
formatter.HeaderContext
trunc bool
json bool
s registry.SearchResult
s registrytypes.SearchResult
}
func (c *searchContext) MarshalJSON() ([]byte, error) {

View File

@ -9,7 +9,7 @@ import (
pluginmanager "github.com/docker/cli/cli-plugins/manager"
"github.com/docker/cli/internal/test"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/swarm"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
@ -69,16 +69,16 @@ var sampleInfoNoSwarm = types.Info{
OSType: "linux",
Architecture: "x86_64",
IndexServerAddress: "https://index.docker.io/v1/",
RegistryConfig: &registry.ServiceConfig{
RegistryConfig: &registrytypes.ServiceConfig{
AllowNondistributableArtifactsCIDRs: nil,
AllowNondistributableArtifactsHostnames: nil,
InsecureRegistryCIDRs: []*registry.NetIPNet{
InsecureRegistryCIDRs: []*registrytypes.NetIPNet{
{
IP: net.ParseIP("127.0.0.0"),
Mask: net.IPv4Mask(255, 0, 0, 0),
},
},
IndexConfigs: map[string]*registry.IndexInfo{
IndexConfigs: map[string]*registrytypes.IndexInfo{
"docker.io": {
Name: "docker.io",
Mirrors: nil,