plugin: add EndpointResolver interface
This defines the interface that the package expects in order to lookup pull endpoints, instead of requiring the whole registry.Service interface. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
61599d0a4d
commit
f9f549cbe4
|
@ -40,6 +40,11 @@ type Executor interface {
|
||||||
Signal(id string, signal int) error
|
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 {
|
func (pm *Manager) restorePlugin(p *v2.Plugin, c *controller) error {
|
||||||
if p.IsEnabled() {
|
if p.IsEnabled() {
|
||||||
return pm.restore(p, c)
|
return pm.restore(p, c)
|
||||||
|
@ -52,7 +57,7 @@ type eventLogger func(id, name, action string)
|
||||||
// ManagerConfig defines configuration needed to start new manager.
|
// ManagerConfig defines configuration needed to start new manager.
|
||||||
type ManagerConfig struct {
|
type ManagerConfig struct {
|
||||||
Store *Store // remove
|
Store *Store // remove
|
||||||
RegistryService registry.Service
|
RegistryService EndpointResolver
|
||||||
LiveRestoreEnabled bool // TODO: remove
|
LiveRestoreEnabled bool // TODO: remove
|
||||||
LogPluginEvent eventLogger
|
LogPluginEvent eventLogger
|
||||||
Root string
|
Root string
|
||||||
|
|
|
@ -7,16 +7,13 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
|
|
||||||
"github.com/docker/docker/dockerversion"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
|
|
||||||
"github.com/containerd/containerd/remotes"
|
"github.com/containerd/containerd/remotes"
|
||||||
"github.com/containerd/containerd/remotes/docker"
|
"github.com/containerd/containerd/remotes/docker"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
"github.com/docker/docker/api/types"
|
"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
|
// scope builds the correct auth scope for the registry client to authorize against
|
||||||
|
|
Loading…
Reference in New Issue