Don't cache exec and mounter in RBD volume plugin

Volume plugin can get a different exec and mounter implementation with every
call, it must not be cached.
This commit is contained in:
Jan Safranek
2017-10-27 13:14:35 +02:00
parent d945927077
commit c718fc2ca7
3 changed files with 15 additions and 13 deletions

View File

@@ -297,7 +297,8 @@ func (util *RBDUtil) DetachDisk(plugin *rbdPlugin, deviceMountPath string, devic
var err error
if len(device) > 0 {
// rbd unmap
_, err = plugin.exec.Run("rbd", "unmap", device)
exec := plugin.host.GetExec(plugin.GetPluginName())
_, err = exec.Run("rbd", "unmap", device)
if err != nil {
return rbdErrors(err, fmt.Errorf("rbd: failed to unmap device %s:Error: %v", device, err))
}