NIFI-8419 This closes #4994. Fix issues with contoller services during parameter context update in a secure instance

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Bryan Bende 2021-04-12 16:54:14 -04:00 committed by Joe Witt
parent 6309ab96d1
commit 1ab4cf5307
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
3 changed files with 5 additions and 4 deletions

View File

@ -1158,7 +1158,7 @@ public class ProcessGroupResource extends FlowUpdateResource<ProcessGroupImportE
URI groupUri;
try {
groupUri = new URI(originalUri.getScheme(), originalUri.getUserInfo(), originalUri.getHost(),
originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", "includeAncestorGroups=false,includeDescendantGroups=true", originalUri.getFragment());
originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", "includeAncestorGroups=false&includeDescendantGroups=true", originalUri.getFragment());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}

View File

@ -454,7 +454,7 @@ public class ClusterReplicationComponentLifecycle implements ComponentLifecycle
URI groupUri;
try {
groupUri = new URI(originalUri.getScheme(), originalUri.getUserInfo(), originalUri.getHost(),
originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", "includeAncestorGroups=false,includeDescendantGroups=true", originalUri.getFragment());
originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", "includeAncestorGroups=false&includeDescendantGroups=true", originalUri.getFragment());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
@ -482,6 +482,7 @@ public class ClusterReplicationComponentLifecycle implements ComponentLifecycle
final Set<ControllerServiceEntity> serviceEntities = controllerServicesEntity.getControllerServices();
final Map<String, AffectedComponentEntity> affectedServices = serviceEntities.stream()
.filter(s -> serviceIds.contains(s.getId()))
.collect(Collectors.toMap(ControllerServiceEntity::getId, dtoFactory::createAffectedComponentEntity));
if (isControllerServiceValidationComplete(serviceEntities, affectedServices)) {

View File

@ -386,11 +386,11 @@ public class LocalComponentLifecycle implements ComponentLifecycle {
boolean allReachedDesiredState = true;
for (final ControllerServiceEntity serviceEntity : serviceEntities) {
final ControllerServiceDTO serviceDto = serviceEntity.getComponent();
if (!affectedServices.containsKey(serviceDto.getId())) {
if (!affectedServices.containsKey(serviceEntity.getId())) {
continue;
}
final ControllerServiceDTO serviceDto = serviceEntity.getComponent();
final String validationStatus = serviceDto.getValidationStatus();
if (ControllerServiceDTO.INVALID.equals(validationStatus)) {
switch (invalidComponentAction) {