mirror of https://github.com/docker/docs.git
fix plugin restart on docker restart
Signed-off-by: Victor Vieux <vieux@docker.com> (cherry picked from commit ab12ed4a5642edb4d96b54b6152f12260093f3ea) Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
fdf513e99d
commit
5cc103e9e9
|
@ -35,7 +35,7 @@ func (pm *Manager) Enable(name string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := pm.enable(p); err != nil {
|
if err := pm.enable(p, false); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
pm.pluginEventLogger(p.PluginObj.ID, name, "enable")
|
pm.pluginEventLogger(p.PluginObj.ID, name, "enable")
|
||||||
|
|
|
@ -321,7 +321,7 @@ func (pm *Manager) init() error {
|
||||||
|
|
||||||
if requiresManualRestore {
|
if requiresManualRestore {
|
||||||
// if liveRestore is not enabled, the plugin will be stopped now so we should enable it
|
// if liveRestore is not enabled, the plugin will be stopped now so we should enable it
|
||||||
if err := pm.enable(p); err != nil {
|
if err := pm.enable(p, true); err != nil {
|
||||||
logrus.Errorf("Error enabling plugin '%s': %s", p.Name(), err)
|
logrus.Errorf("Error enabling plugin '%s': %s", p.Name(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ import (
|
||||||
"github.com/opencontainers/specs/specs-go"
|
"github.com/opencontainers/specs/specs-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (pm *Manager) enable(p *plugin) error {
|
func (pm *Manager) enable(p *plugin, force bool) error {
|
||||||
if p.PluginObj.Active {
|
if p.PluginObj.Active && !force {
|
||||||
return fmt.Errorf("plugin %s is already enabled", p.Name())
|
return fmt.Errorf("plugin %s is already enabled", p.Name())
|
||||||
}
|
}
|
||||||
spec, err := pm.initSpec(p)
|
spec, err := pm.initSpec(p)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"github.com/opencontainers/specs/specs-go"
|
"github.com/opencontainers/specs/specs-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (pm *Manager) enable(p *plugin) error {
|
func (pm *Manager) enable(p *plugin, force bool) error {
|
||||||
return fmt.Errorf("Not implemented")
|
return fmt.Errorf("Not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue