Copilot commented on code in PR #13325:
URL: https://github.com/apache/cloudstack/pull/13325#discussion_r4345003375
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -3602,6 +3613,9 @@ public VpcResponse createVpcResponse(ResponseView view,
Vpc vpc) {
response.setVpcOfferingName(voff.getName());
response.setVpcOfferingConserveMode(voff.isConserveMode());
}
+ VpcDetailVO publicNetworkRateDetail =
vpcDetailsDao.findDetail(vpc.getId(), ApiConstants.PUBLIC_NETWORK_RATE);
+ Integer publicNetworkRate = publicNetworkRateDetail != null ?
NumberUtils.toInt(publicNetworkRateDetail.getValue(), -1) : null;
Review Comment:
If the `vpc_details` entry is missing, the API response will always report
`-1` (unlimited), ignoring the intended precedence (VPC offering > zone
config). Since this field is meant to represent the effective rate, consider
falling back to resolving it via
`_configMgr.getVpcOfferingNetworkRate(vpc.getVpcOfferingId(), vpc.getZoneId())`
when the detail isn’t present, instead of defaulting to `-1`.
--
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]