Merge pull request #33944 from cpuguy83/fix_wrong_dirname
Fix plugin remove dir name after rename. Upstream-commit: 82c2a08b6018586f3c8f35405c3bd6fce3c78ccd Component: engine
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user