allthingssecurity commented on PR #27467: URL: https://github.com/apache/camel/pull/27467#issuecomment-6033652819
Thanks for the review and the test. Pushed 4ff3e46b2105 on top. - I took the second option: a route from a template replaces an existing route with that id only if that route was created from the same template (the template id is now recorded on the route definition). This keeps the update paths you listed working: re-adding the parent route, `populateOrUpdateRoutes`, adviceWith, and reload with `routesReloadRemoveAllRoutes=false`. A Kamelet route id that equals a regular route, or the route of another Kamelet, still fails. Leaving `addRouteFromKamelet` out entirely would let `kamelet:echo/existing` replace a regular route `existing` silently again. - `removeAndReAddParent` is in `KameletExistingRouteIdTest` as you wrote it. It passes now, and it passes on main. I added `updateParent` (`updateRoutesToCamelContext`), plus cases for a Kamelet route id that equals a regular route and one that equals another Kamelet's route. Those two fail on main, as expected. In camel-core, a route from the same template is now replaced, and the other-template case fails. - Known limit: two Kamelet endpoints of the same template with the same route id and different parameters (`kamelet:echo/same?prefix=a` in route a, `?prefix=b` in route b) replace each other again, as on main. The route definition alone cannot tell that case apart from a parent update. It could be caught by recording the parent route id and failing only when the other parent route still exists. I left that out because it adds a new failure on the Kamelet update path. Happy to add it if you think it is worth it. - The upgrade guide note now covers the `FailedToCreateKameletException` wrapping and the same-template case. Tests pass: camel-core 8092, camel-kamelet 91, yaml-dsl 57 and xml-io-dsl 16 (route template / Kamelet / reload), 0 failures. Details are in the PR description. _Claude Code on behalf of allthingssecurity_ -- 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]
