Browse Source

Merge pull request #29337 from anusha-ragunathan/unmount_enable_err

When plugin enable fails, unmount PropagatedMount.
Victor Vieux 8 years ago
parent
commit
e9076c0f00
1 changed files with 5 additions and 0 deletions
  1. 5 0
      plugin/manager_linux.go

+ 5 - 0
plugin/manager_linux.go

@@ -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
 	}