chaojixinren commented on PR #6571: URL: https://github.com/apache/camel-k/pull/6571#issuecomment-4258804401
> Thanks for the work. However, this is not really changing the dynamic creation of the actions. It really complicates that by generating an additional interface that is not really needed. > > What I'd propose is to move the scope of the `actions` array from the func to the struct instead. In this way we just delegate their creation upon initialization instead of having them recreated at every reconcile loop. The only special case is where we have to filter based on a flag. In that case we can think to have 3 arrays and use the one specific to each flag type. Thanks for the feedback. I aligned the implementation with your suggestion by moving the actions from function scope to the reconciler struct, so they are initialized once instead of being recreated on every reconcile. For the Integration controller, I handled the flag-specific case by preparing dedicated action arrays for the synthetic and non-synthetic paths and selecting the appropriate one during reconcile. While doing that, I also fixed a concurrency issue in the catalog controller, where shared action instances could otherwise carry request-scoped mutable state across concurrent reconciliations. -- 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]
