Make sure plugin mounts are cleaned up

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e6f784e3df2095366fd99fd42ab5a2d0b451bd07
Component: engine
This commit is contained in:
Brian Goff
2018-02-07 15:54:52 -05:00
parent eb861a7ae9
commit 32c5b53960
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -19,6 +19,7 @@ import (
"github.com/docker/docker/layer"
"github.com/docker/docker/pkg/authorization"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/mount"
"github.com/docker/docker/pkg/pubsub"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/plugin/v2"
@@ -155,6 +156,10 @@ func (pm *Manager) HandleExitEvent(id string) error {
if restart {
pm.enable(p, c, true)
} else {
if err := mount.RecursiveUnmount(filepath.Join(pm.config.Root, id)); err != nil {
return errors.Wrap(err, "error cleaning up plugin mounts")
}
}
return nil
}
@@ -187,6 +187,9 @@ func (pm *Manager) Shutdown() {
shutdownPlugin(p, c, pm.executor)
}
}
if err := mount.RecursiveUnmount(pm.config.Root); err != nil {
logrus.WithError(err).Warn("error cleaning up plugin mounts")
}
}
func (pm *Manager) upgradePlugin(p *v2.Plugin, configDigest digest.Digest, blobsums []digest.Digest, tmpRootFSDir string, privileges *types.PluginPrivileges) (err error) {