pzampino commented on code in PR #893:
URL: https://github.com/apache/knox/pull/893#discussion_r1541978985
##########
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/ClouderaManagerServiceDiscovery.java:
##########
@@ -422,6 +437,21 @@ private ApiRoleList getRoles(ServiceDiscoveryConfig
serviceDiscoveryConfig, Role
return roles;
}
+ private ApiRoleList excludeRoles(ApiRoleList roles) {
+ if (roles == null || roles.getItems() == null) {
+ return roles;
+ }
+ final ApiRoleList filteredRoles = new ApiRoleList();
+ roles.getItems().forEach(role -> {
+ if (excludedRoleTypes.contains(role.getType())) {
Review Comment:
Same concern as I have with the services wrt case sensitivty.
##########
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/ClouderaManagerServiceDiscovery.java:
##########
@@ -356,6 +361,14 @@ private List<ApiService>
getClusterServices(ServiceDiscoveryConfig serviceDiscov
final ApiServiceList serviceList =
servicesResourceApi.readServices(serviceDiscoveryConfig.getCluster(),
VIEW_SUMMARY);
services = serviceList == null ? new ArrayList<>() :
serviceList.getItems();
+ services = services.stream().filter(service -> {
+ if (excludedServiceTypes.contains(service.getType())) {
Review Comment:
I'm wondering if we can avoid case-sensitivity issues with this. For
example, if the case of the service type is mistyped in the config or changes
on the CM side. Perhaps, we can lowercase the values prior to the comparison?
--
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]