camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Kamelet: Consider restricting the Kamelet route to only allow `from` or `route`

Open igarashitm opened this issue 1 year ago • 1 comments

Requirement

Restrict Kamelet to only allow either route or from, but not both.

Problem

Today we're using Camel RouteTemplateDefinition for the Kamelet route definition, on spec.template. https://github.com/apache/camel/blob/2e7578c9426bb327e0ca8c43b4a93063d70b946e/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json#L4928-L4958

Since RouteTemplateDefinition allows both route and from, currently Kamelet could use both spec.template.route as well as spec.template.from. This is not an ideal situation.

Proposal

2 options in mind:

  1. Change from spec.template to a set of spec.route and spec.beans, where spec.route is a RouteDefinition and spec.beans is an array of RouteTemplateBeanDefinition
  2. Introduce a Camel K custom type for spec.template, then let it have only route and beans

There would be other options. The point here is to restrict the Kamelet route to only allow one of route or from, but not both. At the same time keep the capability to define beans.

Open questions

No response

igarashitm avatar Jan 29 '24 14:01 igarashitm

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Apr 29 '24 00:04 github-actions[bot]