genegr commented on code in PR #13059:
URL: https://github.com/apache/cloudstack/pull/13059#discussion_r3154363544
##########
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java:
##########
@@ -945,22 +886,35 @@ public List<IPAddressVO> listAvailablePublicIps(final
long dcId, final Long podI
if (podId != null) {
sc = AssignIpAddressFromPodVlanSearch.create();
sc.setJoinParameters("podVlanMapSB", "podId", podId);
- errorMessage.append(" pod id=" + podId);
+ errorMessage.append(" pod id=").append(podId);
} else {
sc = AssignIpAddressSearch.create();
- errorMessage.append(" zone id=" + dcId);
+ errorMessage.append(" zone id=").append(dcId);
+ }
+
+ if (lockOneRow) {
+ logger.debug("Listing quarantined public IPs to ignore on search
for public IP for system VM. The IPs ignored will be the ones that: were not
associated to account [{}]; were not removed yet; and with quarantine end dates
after [{}].", owner.getUuid(), new Date());
+
+ List<PublicIpQuarantineVO> quarantinedAddresses =
publicIpQuarantineDao.listQuarantinedIpAddressesToUser(owner.getId(), new
Date());
+ List<Long> quarantinedAddressesIDs =
quarantinedAddresses.stream().map(PublicIpQuarantineVO::getPublicIpAddressId).collect(Collectors.toList());
+
+ logger.debug("Found addresses with the following IDs: [{}] that
will be ignored when searching for available public IPs.",
quarantinedAddressesIDs);
+
+ if (CollectionUtils.isNotEmpty(quarantinedAddressesIDs)) {
+ sc.setParameters("id", quarantinedAddressesIDs.toArray());
+ }
Review Comment:
@sureshanaparti — I think this anchored to the wrong file. `gh api
repos/apache/cloudstack/pulls/13059/files`
shows the only file this PR touches is
`plugins/storage/volume/adaptive/.../AdaptiveDataStoreLifeCycleImpl.java`
(+7/-6) — `IpAddressManagerImpl.java` isn't in the diff. Could you re-anchor
on the
intended hunk so I can address your concern?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]