From 2b7416ef345a7f483fad677d42028e62ad2268b0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 3 Mar 2022 10:33:08 +0100 Subject: testutil, integration: use types/registry.AuthConfig Signed-off-by: Sebastiaan van Stijn --- testutil/fixtures/plugin/plugin.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'testutil') diff --git a/testutil/fixtures/plugin/plugin.go b/testutil/fixtures/plugin/plugin.go index 81ebc41b64..62664ffd1a 100644 --- a/testutil/fixtures/plugin/plugin.go +++ b/testutil/fixtures/plugin/plugin.go @@ -10,9 +10,10 @@ import ( "time" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/plugin" - "github.com/docker/docker/registry" + registrypkg "github.com/docker/docker/registry" "github.com/pkg/errors" ) @@ -26,7 +27,7 @@ type CreateOpt func(*Config) type Config struct { *types.PluginConfig binPath string - RegistryConfig registry.ServiceOptions + RegistryConfig registrypkg.ServiceOptions } // WithInsecureRegistry specifies that the given registry can skip host-key checking as well as fall back to plain http @@ -77,7 +78,7 @@ func Create(ctx context.Context, c CreateClient, name string, opts ...CreateOpt) // This can be useful when testing plugins on swarm where you don't really want // the plugin to exist on any of the daemons (immediately) and there needs to be // some way to distribute the plugin. -func CreateInRegistry(ctx context.Context, repo string, auth *types.AuthConfig, opts ...CreateOpt) error { +func CreateInRegistry(ctx context.Context, repo string, auth *registry.AuthConfig, opts ...CreateOpt) error { tmpDir, err := os.MkdirTemp("", "create-test-plugin-local") if err != nil { return err @@ -105,7 +106,7 @@ func CreateInRegistry(ctx context.Context, repo string, auth *types.AuthConfig, return nil, nil } - regService, err := registry.NewService(cfg.RegistryConfig) + regService, err := registrypkg.NewService(cfg.RegistryConfig) if err != nil { return err } @@ -130,7 +131,7 @@ func CreateInRegistry(ctx context.Context, repo string, auth *types.AuthConfig, } if auth == nil { - auth = &types.AuthConfig{} + auth = ®istry.AuthConfig{} } err = manager.Push(ctx, repo, nil, auth, io.Discard) return errors.Wrap(err, "error pushing plugin") -- cgit v1.2.1