When plugin enable fails, unmount PropagatedMount.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: cef443bddf2a185b3afa2f5c7333fd461c87ae74
Component: engine
This commit is contained in:
Anusha Ragunathan
2016-12-12 12:56:44 -08:00
parent c770ae1fee
commit 5710a52064

View File

@ -41,6 +41,11 @@ func (pm *Manager) enable(p *v2.Plugin, c *controller, force bool) error {
}
if err := pm.containerdClient.Create(p.GetID(), "", "", specs.Spec(*spec), attachToLog(p.GetID())); err != nil {
if p.PropagatedMount != "" {
if err := mount.Unmount(p.PropagatedMount); err != nil {
logrus.Warnf("Could not unmount %s: %v", p.PropagatedMount, err)
}
}
return err
}