gnodet-bot commented on code in PR #27467:
URL: https://github.com/apache/camel/pull/27467#discussion_r4205501244


##########
core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java:
##########
@@ -645,6 +645,21 @@ protected String doAddRouteFromTemplate(
         if (group != null) {
             def.setGroup(group);
         }
+        // a route from a template (or a Kamelet) must not replace an existing 
route with the same id, unless that
+        // route was created from the same template (such as the route of a 
Kamelet with a route id that is created
+        // again when its parent route is updated)

Review Comment:
   💡 **Nit:** The comment describes only the same-template exception case, but 
the guard at line 655 also rejects routes where `existing == null` yet 
`camelContext.getRoute(id) != null` (i.e. a route that exists at runtime but 
not in the model). Consider mentioning this second branch:
   
   ```suggestion
           // a route from a template (or a Kamelet) must not replace an 
existing route with the same id, unless that
           // route was created from the same template (such as the route of a 
Kamelet with a route id that is created
           // again when its parent route is updated). Runtime-only routes 
(present in the context but not the model)
           // are also protected.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to