From 4bf263c19873718394f8161dbc020bf4be30f9d6 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 4 Jul 2017 07:37:26 -0400 Subject: [PATCH] Fix plugin remove dir name after rename. Signed-off-by: Brian Goff --- plugin/backend_linux.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/backend_linux.go b/plugin/backend_linux.go index b22cc155d2..d65b90a2b7 100644 --- a/plugin/backend_linux.go +++ b/plugin/backend_linux.go @@ -630,11 +630,12 @@ func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error { return errors.Wrap(err, "error unmounting plugin data") } - if err := os.Rename(pluginDir, pluginDir+"-removing"); err != nil { + removeDir := pluginDir + "-removing" + if err := os.Rename(pluginDir, removeDir); err != nil { return errors.Wrap(err, "error performing atomic remove of plugin dir") } - if err := system.EnsureRemoveAll(pluginDir); err != nil { + if err := system.EnsureRemoveAll(removeDir); err != nil { return errors.Wrap(err, "error removing plugin dir") } pm.config.Store.Remove(p)