NIFI-10140 Handle deleted parameters in StandardVersionedComponentSynchronizer

Signed-off-by: Joe Gresock <jgresock@gmail.com>
This closes #6138.
This commit is contained in:
Bryan Bende 2022-06-20 12:09:27 -04:00 committed by Joe Gresock
parent eef4ea1fc6
commit 1de9c72779
No known key found for this signature in database
GPG Key ID: 37F5B9B6E258C8B7
1 changed files with 8 additions and 0 deletions

View File

@ -1433,6 +1433,14 @@ public class StandardVersionedComponentSynchronizer implements VersionedComponen
} else {
final Map<String, Parameter> updatedParameters = createParameterMap(proposed.getParameters());
// If any parameters are removed, need to add a null value to the map in order to make sure that the parameter is removed.
for (final ParameterDescriptor existingParameterDescriptor : parameterContext.getParameters().keySet()) {
final String name = existingParameterDescriptor.getName();
if (!updatedParameters.containsKey(name)) {
updatedParameters.put(name, null);
}
}
final Map<String, ParameterContext> contextsByName = contextManager.getParameterContextNameMapping();
final List<ParameterContext> inheritedContexts = new ArrayList<>();
final List<String> inheritedContextNames = proposed.getInheritedParameterContexts();