DaanHoogland commented on a change in pull request #3575: [WIP DO NOT MERGE] 
Health check feature for virtual router
URL: https://github.com/apache/cloudstack/pull/3575#discussion_r367913299
 
 

 ##########
 File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
 ##########
 @@ -1197,19 +1194,15 @@
         Pair<List<DomainRouterJoinVO>, Integer> result = 
searchForRoutersInternal(cmd, cmd.getId(), cmd.getRouterName(), cmd.getState(), 
cmd.getZoneId(), cmd.getPodId(), null, cmd.getHostId(),
                 cmd.getKeyword(), cmd.getNetworkId(), cmd.getVpcId(), 
cmd.getForVpc(), cmd.getRole(), null);
         ListResponse<DomainRouterResponse> response = new 
ListResponse<DomainRouterResponse>();
-        if (!VirtualNetworkApplianceManager.RouterHealthChecksEnabled.value()) 
{
-            s_logger.debug("Skipping health checks data for internal lbvms as 
it's router.health.checks.enabled is false");
-            return response;
-        }
-
-
         List<DomainRouterResponse> routerResponses = 
ViewResponseHelper.createDomainRouterResponse(result.first().toArray(new 
DomainRouterJoinVO[result.first().size()]));
         for (DomainRouterResponse res : routerResponses) {
             DomainRouterVO resRouter = _routerDao.findByUuid(res.getId());
-            
res.setHealthChecksFailed(routerHealthCheckResultDao.hasFailingChecks(resRouter.getId()));
-            if (cmd.shouldFetchHealthCheckResults()) {
-                
res.setHealthCheckResults(responseGenerator.createHealthCheckResponse(resRouter,
-                        new 
ArrayList<>(routerHealthCheckResultDao.getHealthCheckResults(resRouter.getId()))));
+            if 
(VirtualNetworkApplianceManager.RouterHealthChecksEnabled.value()) {
 
 Review comment:
   why put this condition in the loop? it seems its value would not depend on 
the iteration

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to