mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: split the parsing and deletion logic to its own functions.
parseAndDeleteMigratedVolume() prviously clubbed the logic of parsing of migration volume handle and then continued with the deletion of the volume. however this commit split this logic into two, ie parsing has been done in parseMigrationVolID() and DeleteMigratedVolume() deletes the backend volume. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
ff0911fb6a
commit
5621f2cfca
@ -851,11 +851,15 @@ func (cs *ControllerServer) DeleteVolume(
|
||||
}
|
||||
defer cs.OperationLocks.ReleaseDeleteLock(volumeID)
|
||||
|
||||
// if this is a migration request volID, delete the volume in backend
|
||||
if isMigrationVolID(volumeID) {
|
||||
log.DebugLog(ctx, "migration volume ID : %s", volumeID)
|
||||
err = parseAndDeleteMigratedVolume(ctx, volumeID, cr)
|
||||
if err != nil && !errors.Is(err, ErrImageNotFound) {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
pmVolID, pErr := parseMigrationVolID(volumeID)
|
||||
if pErr != nil {
|
||||
return nil, status.Error(codes.InvalidArgument, pErr.Error())
|
||||
}
|
||||
pErr = deleteMigratedVolume(ctx, pmVolID, cr)
|
||||
if pErr != nil && !errors.Is(pErr, ErrImageNotFound) {
|
||||
return nil, status.Error(codes.Internal, pErr.Error())
|
||||
}
|
||||
|
||||
return &csi.DeleteVolumeResponse{}, nil
|
||||
|
Reference in New Issue
Block a user