Skip to content

Commit 1a86cbb

Browse files
anusha-ragunathanvieux
authored andcommitted
When plugin enable fails, unmount PropagatedMount.
Signed-off-by: Anusha Ragunathan <anusha@docker.com> (cherry picked from commit cef443b) Signed-off-by: Victor Vieux <vieux@docker.com>
1 parent 80c3ed1 commit 1a86cbb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugin/manager_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ func (pm *Manager) enable(p *v2.Plugin, c *controller, force bool) error {
4141
}
4242

4343
if err := pm.containerdClient.Create(p.GetID(), "", "", specs.Spec(*spec), attachToLog(p.GetID())); err != nil {
44+
if p.PropagatedMount != "" {
45+
if err := mount.Unmount(p.PropagatedMount); err != nil {
46+
logrus.Warnf("Could not unmount %s: %v", p.PropagatedMount, err)
47+
}
48+
}
4449
return err
4550
}
4651

0 commit comments

Comments
 (0)