diff --git a/plugin/manager.go b/plugin/manager.go index 85423ce5d3..3296ba4e77 100644 --- a/plugin/manager.go +++ b/plugin/manager.go @@ -40,6 +40,11 @@ type Executor interface { Signal(id string, signal int) error } +// EndpointResolver provides looking up registry endpoints for pulling. +type EndpointResolver interface { + LookupPullEndpoints(hostname string) (endpoints []registry.APIEndpoint, err error) +} + func (pm *Manager) restorePlugin(p *v2.Plugin, c *controller) error { if p.IsEnabled() { return pm.restore(p, c) @@ -52,7 +57,7 @@ type eventLogger func(id, name, action string) // ManagerConfig defines configuration needed to start new manager. type ManagerConfig struct { Store *Store // remove - RegistryService registry.Service + RegistryService EndpointResolver LiveRestoreEnabled bool // TODO: remove LogPluginEvent eventLogger Root string diff --git a/plugin/registry.go b/plugin/registry.go index ad2a6b7138..e7643b6aaf 100644 --- a/plugin/registry.go +++ b/plugin/registry.go @@ -7,16 +7,13 @@ import ( "net/http" "time" - "github.com/sirupsen/logrus" - - "github.com/docker/docker/dockerversion" - - "github.com/pkg/errors" - "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" + "github.com/docker/docker/dockerversion" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // scope builds the correct auth scope for the registry client to authorize against