1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Don't unmount entire plugin manager tree on remove

This was mistakenly unmounting everything under `plugins/*` instead of
just `plugins/<id>/*` anytime a plugin is removed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2017-05-27 12:30:37 -04:00
parent e925820bfd
commit db5f31732a

View file

@ -633,8 +633,8 @@ func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
id := p.GetID() id := p.GetID()
pm.config.Store.Remove(p) pm.config.Store.Remove(p)
pluginDir := filepath.Join(pm.config.Root, id) pluginDir := filepath.Join(pm.config.Root, id)
if err := recursiveUnmount(pm.config.Root); err != nil { if err := recursiveUnmount(pluginDir); err != nil {
logrus.WithField("dir", pm.config.Root).WithField("id", id).Warn(err) logrus.WithField("dir", pluginDir).WithField("id", id).Warn(err)
} }
if err := os.RemoveAll(pluginDir); err != nil { if err := os.RemoveAll(pluginDir); err != nil {
logrus.Warnf("unable to remove %q from plugin remove: %v", pluginDir, err) logrus.Warnf("unable to remove %q from plugin remove: %v", pluginDir, err)