浏览代码

Merge pull request #29337 from anusha-ragunathan/unmount_enable_err

When plugin enable fails, unmount PropagatedMount.
Victor Vieux 8 年之前
父节点
当前提交
e9076c0f00
共有 1 个文件被更改,包括 5 次插入0 次删除
  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
 	}