Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Fix plugin remove dir name after rename.
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
  • Loading branch information
cpuguy83 committed Jul 4, 2017
1 parent a9358df commit 4bf263c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/backend_linux.go
Expand Up @@ -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)
Expand Down

0 comments on commit 4bf263c

Please sign in to comment.