summaryrefslogtreecommitdiff
path: root/testutil
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-03-03 10:33:08 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-07-29 23:05:21 +0200
commit2b7416ef345a7f483fad677d42028e62ad2268b0 (patch)
treede9c2202fcb8098171bb3834dc8c5a5a64af91eb /testutil
parentd817f4dcee626b892ab94ccae2e6e71f1b29426b (diff)
downloaddocker-2b7416ef345a7f483fad677d42028e62ad2268b0.tar.gz
testutil, integration: use types/registry.AuthConfig
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'testutil')
-rw-r--r--testutil/fixtures/plugin/plugin.go11
1 files changed, 6 insertions, 5 deletions
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 = &registry.AuthConfig{}
}
err = manager.Push(ctx, repo, nil, auth, io.Discard)
return errors.Wrap(err, "error pushing plugin")