Merge pull request #25553 from vieux/restart_plugin
fix plugins restart on docker restart Upstream-commit: 93b9b19204cc82a5b7205726f452020e209903d1 Component: engine
This commit is contained in:
@ -35,7 +35,7 @@ func (pm *Manager) Enable(name string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := pm.enable(p); err != nil {
|
||||
if err := pm.enable(p, false); err != nil {
|
||||
return err
|
||||
}
|
||||
pm.pluginEventLogger(p.PluginObj.ID, name, "enable")
|
||||
|
||||
@ -321,7 +321,7 @@ func (pm *Manager) init() error {
|
||||
|
||||
if requiresManualRestore {
|
||||
// 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("failed to enable plugin '%s': %s", p.Name(), err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,8 +20,8 @@ import (
|
||||
"github.com/opencontainers/specs/specs-go"
|
||||
)
|
||||
|
||||
func (pm *Manager) enable(p *plugin) error {
|
||||
if p.PluginObj.Active {
|
||||
func (pm *Manager) enable(p *plugin, force bool) error {
|
||||
if p.PluginObj.Active && !force {
|
||||
return fmt.Errorf("plugin %s is already enabled", p.Name())
|
||||
}
|
||||
spec, err := pm.initSpec(p)
|
||||
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user