This is an automated email from the ASF dual-hosted git repository.

briansolo1985 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new c12842fc83 NIFI-13309 Lookup compatible bundles even if previous flow 
was empty
c12842fc83 is described below

commit c12842fc83d0d68fa8091f639f6df7d259d0d0c0
Author: Ferenc Erdei <[email protected]>
AuthorDate: Wed May 29 12:13:06 2024 +0200

    NIFI-13309 Lookup compatible bundles even if previous flow was empty
    
    Signed-off-by: Ferenc Kis <[email protected]>
    
    This closes #8888.
---
 .../nifi/controller/serialization/VersionedFlowSynchronizer.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedFlowSynchronizer.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedFlowSynchronizer.java
index 6217dfd306..c780ba348b 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedFlowSynchronizer.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedFlowSynchronizer.java
@@ -167,7 +167,7 @@ public class VersionedFlowSynchronizer implements 
FlowSynchronizer {
 
         // If bundle update strategy is configured to allow for compatible 
bundles, update any components to use compatible bundles if
         // the exact bundle does not exist.
-        if (!existingFlowEmpty && bundleUpdateStrategy == 
BundleUpdateStrategy.USE_SPECIFIED_OR_COMPATIBLE_OR_GHOST) {
+        if (bundleUpdateStrategy == 
BundleUpdateStrategy.USE_SPECIFIED_OR_COMPATIBLE_OR_GHOST) {
             mapCompatibleBundles(proposedFlow, 
controller.getExtensionManager());
         }
 
@@ -257,6 +257,10 @@ public class VersionedFlowSynchronizer implements 
FlowSynchronizer {
         final Set<String> missingComponentIds = 
proposedFlow.getMissingComponents();
         final VersionedDataflow dataflow = proposedFlow.getVersionedDataflow();
 
+        if (isFlowEmpty(dataflow)) {
+            return;
+        }
+
         if (dataflow.getReportingTasks() == null) {
             dataflow.setReportingTasks(new ArrayList<>());
         }

Reply via email to