|
@@ -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")
|