Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private List<String> volumesCleanupFromAction(CascadeAction action) {
}

volumeUuids = ResourceHelper.findOwnResourceUuidList(VolumeEO.class, auuids,
q -> q.eq(VolumeVO_.type, VolumeType.Data));
q -> q.in(VolumeVO_.type, Arrays.asList(VolumeType.Data, VolumeType.Memory)));
return volumeUuids;
}

Expand All @@ -168,15 +168,16 @@ private List<VolumeDeletionStruct> volumesFromAction(CascadeAction action) {
List<String> psUuids = CollectionUtils.transform(pinvs, PrimaryStorageInventory::getUuid);

SimpleQuery<VolumeVO> q = dbf.createQuery(VolumeVO.class);
q.add(VolumeVO_.type, Op.EQ, VolumeType.Data);
q.add(VolumeVO_.type, Op.IN, Arrays.asList(VolumeType.Data, VolumeType.Memory));
q.add(VolumeVO_.primaryStorageUuid, Op.IN, psUuids);
List<VolumeVO> vos = q.list();
return toVolumeDeletionStruct(action, vos);
} else if (AccountVO.class.getSimpleName().equals(action.getParentIssuer())) {
final List<String> auuids = CollectionUtils.transform(action.getParentIssuerContext(), AccountInventory::getUuid);

List<VolumeVO> vos = ResourceHelper.findOwnResources(VolumeVO.class, auuids);
vos.removeIf(volume -> volume.getType() != VolumeType.Data);
vos.removeIf(volume -> volume.getType() != VolumeType.Data
&& volume.getType() != VolumeType.Memory);

if (!vos.isEmpty()) {
return toVolumeDeletionStruct(action, vos);
Expand Down