node server: don't persist vol

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen
2018-02-20 16:10:59 +00:00
parent c7ba5a6f8b
commit 9d4b49b54b
2 changed files with 21 additions and 29 deletions

View File

@ -256,19 +256,14 @@ func attachRBDImage(volOptions *rbdVolumeOptions) (string, error) {
return devicePath, nil
}
func detachRBDImage(volOptions *rbdVolumeOptions) error {
func detachRBDDevice(devicePath string) error {
var err error
var output []byte
image := volOptions.VolName
glog.V(1).Infof("rbd: unmap device %s", image)
id := volOptions.UserID
secret := volOptions.UserSecret
glog.V(3).Infof("rbd: unmap device %s", devicePath)
output, err = execCommand("rbd", []string{
"unmap", image, "--id", id, "--key=" + secret})
output, err = execCommand("rbd", []string{"unmap", devicePath})
if err != nil {
glog.V(1).Infof("rbd: unmap error %v, rbd output: %s", err, string(output))
return fmt.Errorf("rbd: unmap failed %v, rbd output: %s", err, string(output))
}