mirror of https://github.com/docker/cli.git
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:
parent
b7e4f3daa6
commit
e40529aa3b
|
@ -5,7 +5,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/command/formatter"
|
"github.com/docker/cli/cli/command/formatter"
|
||||||
registry "github.com/docker/docker/api/types/registry"
|
registrytypes "github.com/docker/docker/api/types/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -28,7 +28,7 @@ func NewSearchFormat(source string) formatter.Format {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchWrite writes the context
|
// 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 {
|
render := func(format func(subContext formatter.SubContext) error) error {
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
searchCtx := &searchContext{trunc: ctx.Trunc, s: result}
|
searchCtx := &searchContext{trunc: ctx.Trunc, s: result}
|
||||||
|
@ -53,7 +53,7 @@ type searchContext struct {
|
||||||
formatter.HeaderContext
|
formatter.HeaderContext
|
||||||
trunc bool
|
trunc bool
|
||||||
json bool
|
json bool
|
||||||
s registry.SearchResult
|
s registrytypes.SearchResult
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *searchContext) MarshalJSON() ([]byte, error) {
|
func (c *searchContext) MarshalJSON() ([]byte, error) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
pluginmanager "github.com/docker/cli/cli-plugins/manager"
|
pluginmanager "github.com/docker/cli/cli-plugins/manager"
|
||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
"github.com/docker/docker/api/types"
|
"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"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
|
@ -69,16 +69,16 @@ var sampleInfoNoSwarm = types.Info{
|
||||||
OSType: "linux",
|
OSType: "linux",
|
||||||
Architecture: "x86_64",
|
Architecture: "x86_64",
|
||||||
IndexServerAddress: "https://index.docker.io/v1/",
|
IndexServerAddress: "https://index.docker.io/v1/",
|
||||||
RegistryConfig: ®istry.ServiceConfig{
|
RegistryConfig: ®istrytypes.ServiceConfig{
|
||||||
AllowNondistributableArtifactsCIDRs: nil,
|
AllowNondistributableArtifactsCIDRs: nil,
|
||||||
AllowNondistributableArtifactsHostnames: nil,
|
AllowNondistributableArtifactsHostnames: nil,
|
||||||
InsecureRegistryCIDRs: []*registry.NetIPNet{
|
InsecureRegistryCIDRs: []*registrytypes.NetIPNet{
|
||||||
{
|
{
|
||||||
IP: net.ParseIP("127.0.0.0"),
|
IP: net.ParseIP("127.0.0.0"),
|
||||||
Mask: net.IPv4Mask(255, 0, 0, 0),
|
Mask: net.IPv4Mask(255, 0, 0, 0),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
IndexConfigs: map[string]*registry.IndexInfo{
|
IndexConfigs: map[string]*registrytypes.IndexInfo{
|
||||||
"docker.io": {
|
"docker.io": {
|
||||||
Name: "docker.io",
|
Name: "docker.io",
|
||||||
Mirrors: nil,
|
Mirrors: nil,
|
||||||
|
|
Loading…
Reference in New Issue