bonampak commented on code in PR #1395:
URL: https://github.com/apache/knox/pull/1395#discussion_r4327971320


##########
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/monitor/PollingConfigurationAnalyzer.java:
##########
@@ -618,22 +751,33 @@ protected ServiceConfigurationModel 
getCurrentServiceConfiguration(final String
 
       ApiRoleConfigList roleConfigList = 
roleCollector.getAllServiceRoleConfigurations(clusterName, service);
 
-      for (ApiRoleConfig roleConfig : roleConfigList.getItems()) {
-        ApiConfigList configList = roleConfig.getConfig();
-
-        String roleName = roleConfig.getName();
-        String roleType = roleConfig.getRoleType();
-        ApiHostRef hostRef = roleConfig.getHostRef();
-        ApiRole role = new 
ApiRole().name(roleName).type(roleType).hostRef(hostRef);
-        roleConfigs.put(role, configList);
-      }
-      currentConfig = new ServiceConfigurationModel(svcConfig, roleConfigs);
+      final ApiService apiService = new 
ApiService().name(service).type(serviceType);

Review Comment:
   Fixed:
   - 8c06e4da3: fixes the clusterRef NPE by passing the real ApiService from 
the cluster's service list.
   - 0561951d9: adds the test that runs every registered generator against 
monitor-shaped inputs.
   - dd30643b6: adds the RuntimeException guard so a failing generator no 
longer ends the whole polling cycle, and tightens its test.
   
   For hostRef, the shared ServiceModelFactory from 7cc335a15 already covered 
it.
   
   



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