prashanthr2 commented on code in PR #14421:
URL: https://github.com/apache/cloudstack/pull/14421#discussion_r4300437064


##########
engine/schema/src/main/java/org/apache/cloudstack/network/Ipv4GuestSubnetNetworkMapVO.java:
##########
@@ -46,6 +46,9 @@ public class Ipv4GuestSubnetNetworkMapVO implements 
Ipv4GuestSubnetNetworkMap {
     @Column(name = "parent_id")
     private Long parentId;
 
+    @Column(name = "data_center_id")
+    private Long dataCenterId;

Review Comment:
   Good catch, thanks  @Damans227  and it’s a bit worse than parentless rows. 
The zoneid filter resolves the zone through dc_ip4_guest_subnets:
   
   ```
   List<DataCenterIpv4GuestSubnetVO> subnets = 
dataCenterIpv4GuestSubnetDao.listByDataCenterId(zoneId);
   if (CollectionUtils.isEmpty(subnets)) {
       return new ArrayList<>();
   }
   sc.addAnd("parentId", SearchCriteria.Op.IN, parentIds.toArray());
   ```
   
   So if the zone has no zone-level subnet configured at all, the list returns 
empty even when routed VPCs exist there , which is exactly the setup in #14419. 
createIpv4SubnetForGuestNetworkResponse has the same gap: zoneId is only 
derived from the network, VPC or parent, so a parentless unassigned row reports 
no zone.
   
   Now that the row carries the zone, I’ll replace the parent-id lookup with a 
direct data_center_id filter and add it as a fallback in the response (that 
needs getDataCenterId() on the Ipv4GuestSubnetNetworkMap interface). Rows that 
predate the upgrade and can’t be attributed to a zone keep data_center_id = 
NULL and still won’t show under a zone filter  same as today, so no regression. 
Pushing shortly.



-- 
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]

Reply via email to