shwstppr commented on code in PR #6425:
URL: https://github.com/apache/cloudstack/pull/6425#discussion_r902537211


##########
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
##########
@@ -422,6 +423,38 @@ public void setDhcpProviders(final 
List<DhcpServiceProvider> dhcpProviders) {
 
     HashMap<Long, Long> _lastNetworkIdsToFree = new HashMap<Long, Long>();
 
+    private void updateRouterDefaultDns(final VirtualMachineProfile vmProfile, 
final NicProfile nicProfile) {
+        if (!Type.DomainRouter.equals(vmProfile.getType()) || 
!nicProfile.isDefaultNic()) {
+            return;
+        }
+        DomainRouterVO router = routerDao.findById(vmProfile.getId());
+        if (router != null && router.getVpcId() != null) {
+            final Vpc vpc = _vpcMgr.getActiveVpc(router.getVpcId());
+            if (StringUtils.isNotBlank(vpc.getDns1())) {
+                nicProfile.setIPv4Dns1(vpc.getDns1());
+                nicProfile.setIPv4Dns2(vpc.getDns2());

Review Comment:
   @nvazquez we have a check in createNetwork/Vpc API which will allow dns2 or 
ip6Dns2 to have a value only when dns1/ip6Dns1has a value. Therefore, if it is 
null then nicProfile should also have null value



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