[ https://issues.apache.org/jira/browse/KNOX-3026?focusedWorklogId=911911&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-911911 ]
ASF GitHub Bot logged work on KNOX-3026: ---------------------------------------- Author: ASF GitHub Bot Created on: 27/Mar/24 20:23 Start Date: 27/Mar/24 20:23 Worklog Time Spent: 10m Work Description: 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? Issue Time Tracking ------------------- Worklog Id: (was: 911911) Time Spent: 20m (was: 10m) > Exclude services/roles from being discovered > -------------------------------------------- > > Key: KNOX-3026 > URL: https://issues.apache.org/jira/browse/KNOX-3026 > Project: Apache Knox > Issue Type: Improvement > Affects Versions: 2.0.0, 1.6.0 > Reporter: Sandor Molnar > Assignee: Sandor Molnar > Priority: Critical > Fix For: 2.1.0 > > Time Spent: 20m > Remaining Estimate: 0h > > Currently, even after implementing KNOX-2899, CM service discovery is running > on the entire CM cluster and fetches information on all services and roles > that are available on that target cluster. We may want to revisit the > service-based discovery enablement (that is now disabled by KNOX-2899). > However, there is a need for end-users to be able to declare services and > roles that should be explicitly excluded during service discovery. -- This message was sent by Atlassian Jira (v8.20.10#820010)