Skip to content

Commit

Permalink
fix plugin restart on docker restart
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Vieux <vieux@docker.com>
  • Loading branch information
vieux committed Aug 9, 2016
1 parent 91853e4 commit ab12ed4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion plugin/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion plugin/manager_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit ab12ed4

Please sign in to comment.