зеркало из https://github.com/microsoft/docker.git
Merge pull request #24776 from anusha-ragunathan/plugins-connect
Add only legacy plugins to the legacy lookup map.
This commit is contained in:
Коммит
6875f71d7c
|
@ -83,6 +83,11 @@ func (p *Plugin) Client() *Client {
|
|||
return p.client
|
||||
}
|
||||
|
||||
// IsLegacy returns true for legacy plugins and false otherwise.
|
||||
func (p *Plugin) IsLegacy() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// NewLocalPlugin creates a new local plugin.
|
||||
func NewLocalPlugin(name, addr string) *Plugin {
|
||||
return &Plugin{
|
||||
|
|
|
@ -6,4 +6,5 @@ import "github.com/docker/docker/pkg/plugins"
|
|||
type Plugin interface {
|
||||
Client() *plugins.Client
|
||||
Name() string
|
||||
IsLegacy() bool
|
||||
}
|
||||
|
|
|
@ -54,6 +54,11 @@ func (p *plugin) Client() *plugins.Client {
|
|||
return p.client
|
||||
}
|
||||
|
||||
// IsLegacy returns true for legacy plugins and false otherwise.
|
||||
func (p *plugin) IsLegacy() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *plugin) Name() string {
|
||||
name := p.P.Name
|
||||
if len(p.P.Tag) > 0 {
|
||||
|
|
|
@ -118,7 +118,9 @@ func lookup(name string) (volume.Driver, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
drivers.extensions[name] = d
|
||||
if p.IsLegacy() {
|
||||
drivers.extensions[name] = d
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
@ -174,7 +176,9 @@ func GetAllDrivers() ([]volume.Driver, error) {
|
|||
}
|
||||
|
||||
ext = NewVolumeDriver(name, p.Client())
|
||||
drivers.extensions[name] = ext
|
||||
if p.IsLegacy() {
|
||||
drivers.extensions[name] = ext
|
||||
}
|
||||
ds = append(ds, ext)
|
||||
}
|
||||
return ds, nil
|
||||
|
|
Загрузка…
Ссылка в новой задаче