camel-k
camel-k copied to clipboard
Kamelet: Consider restricting the Kamelet route to only allow `from` or `route`
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:
- Change from
spec.template
to a set ofspec.route
andspec.beans
, wherespec.route
is aRouteDefinition
andspec.beans
is an array ofRouteTemplateBeanDefinition
- Introduce a Camel K custom type for
spec.template
, then let it have onlyroute
andbeans
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
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!