NIFI-7944: When checking if a Component can reference a Controller Service, NiFi would sometimes fail to find that Controller Service because it was looking based on the wrong Process Group. Fixed that. (#4619)

This commit is contained in:
markap14 2020-10-27 08:57:05 -04:00 committed by GitHub
parent 6e9bef1428
commit 67d1b73a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -959,7 +959,7 @@ public final class StandardProcessGroup implements ProcessGroup {
final Class<? extends ControllerService> serviceClass = propertyDescriptor.getControllerServiceDefinition();
if (serviceClass != null) {
final boolean validReference = isValidServiceReference(serviceId, serviceClass);
final boolean validReference = isValidServiceReference(serviceId, serviceClass, component);
final ControllerServiceNode serviceNode = controllerServiceProvider.getControllerServiceNode(serviceId);
if (serviceNode != null) {
if (validReference) {
@ -972,8 +972,8 @@ public final class StandardProcessGroup implements ProcessGroup {
}
}
private boolean isValidServiceReference(final String serviceId, final Class<? extends ControllerService> serviceClass) {
final Set<String> validServiceIds = controllerServiceProvider.getControllerServiceIdentifiers(serviceClass, getIdentifier());
private boolean isValidServiceReference(final String serviceId, final Class<? extends ControllerService> serviceClass, final ComponentNode component) {
final Set<String> validServiceIds = controllerServiceProvider.getControllerServiceIdentifiers(serviceClass, component.getProcessGroupIdentifier());
return validServiceIds.contains(serviceId);
}