mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 22:30:23 +00:00
unmap rbd volume if we fail to get devicepath
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
5d85f965df
commit
d350b13d02
@ -284,6 +284,11 @@ func createPath(volOpt *rbdVolume, cr *util.Credentials) (string, error) {
|
||||
}
|
||||
devicePath, found := waitForPath(volOpt.Pool, image, 10, useNBD)
|
||||
if !found {
|
||||
output, err := execCommand(cmdName, []string{
|
||||
"unmap", imagePath, "--id", cr.ID, "-m", volOpt.Monitors, "--keyfile=" + cr.KeyFile})
|
||||
if err != nil {
|
||||
klog.Warningf("rbd: unmap error %v, rbd output: %s", err, string(output))
|
||||
}
|
||||
return "", fmt.Errorf("could not map image %s, Timeout after 10s", imagePath)
|
||||
}
|
||||
return devicePath, nil
|
||||
|
Loading…
Reference in New Issue
Block a user