mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
rbd: fixed csi-rbdplugin crashes when decoding volume ID failed
Signed-off-by: HF <crazytaxii666@gmail.com>
This commit is contained in:
parent
b3ef8672a4
commit
80ad5b6b8f
@ -922,7 +922,11 @@ func (cs *ControllerServer) DeleteVolume(
|
|||||||
}
|
}
|
||||||
|
|
||||||
rbdVol, err := GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
rbdVol, err := GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||||
defer rbdVol.Destroy()
|
defer func() {
|
||||||
|
if rbdVol != nil {
|
||||||
|
rbdVol.Destroy()
|
||||||
|
}
|
||||||
|
}()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cs.checkErrAndUndoReserve(ctx, err, volumeID, rbdVol, cr)
|
return cs.checkErrAndUndoReserve(ctx, err, volumeID, rbdVol, cr)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user