weizhouapache commented on code in PR #9410:
URL: https://github.com/apache/cloudstack/pull/9410#discussion_r1686542701


##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -6412,6 +6420,23 @@ public NetworkOffering createNetworkOffering(final 
CreateNetworkOfferingCmd cmd)
         return offering;
     }
 
+    public static NetworkOffering.RoutingMode verifyRoutingMode(String 
routingModeString) {
+        NetworkOffering.RoutingMode routingMode = null;
+        if (routingModeString != null) {
+            try {
+                if 
(!SUPPORTED_ROUTING_MODE_STRS.contains(routingModeString.toLowerCase())) {

Review Comment:
   EnumUtils has some methods to ignore case, for example
   `isValidEnumIgnoreCase`
   `getEnumIgnoreCase`



##########
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java:
##########
@@ -266,6 +273,12 @@ public class VpcManagerImpl extends ManagerBase implements 
VpcManager, VpcProvis
     @Qualifier("networkHelper")
     protected NetworkHelper networkHelper;
     @Inject
+    private NsxService nsxService;

Review Comment:
   `nsxService` is not used in this class



##########
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java:
##########
@@ -2109,6 +2151,13 @@ public boolean cleanupVpcResources(final long vpcId, 
final Account caller, final
 
         VpcVO vpc = vpcDao.findById(vpcId);
         
annotationDao.removeByEntityType(AnnotationService.EntityType.VPC.name(), 
vpc.getUuid());
+
+        ASNumberVO asNumber = asNumberDao.findByZoneAndVpcId(vpc.getZoneId(), 
vpc.getId());

Review Comment:
   this can be moved into the method `bgpService.releaseASNumber`



##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -6582,6 +6608,18 @@ public NetworkOfferingVO createNetworkOffering(final 
String name, final String d
             }
         }
 
+        if (specifyAsNumber && Dynamic != routingMode) {

Review Comment:
   use `.equals` instead of `!=` ?
   



##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -839,7 +848,7 @@ private void 
validateManagedKubernetesClusterCreateParameters(final CreateKubern
     }
 
     private Network getKubernetesClusterNetworkIfMissing(final String 
clusterName, final DataCenter zone,  final Account owner, final int 
controlNodesCount,
-                         final int nodesCount, final String 
externalLoadBalancerIpAddress, final Long networkId) throws 
CloudRuntimeException {
+                         final int nodesCount, final String 
externalLoadBalancerIpAddress, final Long networkId, final Long asNumber) 
throws CloudRuntimeException {

Review Comment:
   it looks like thanges in `plugins/integrations/kubernetes-service/` are not 
needed.



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