Skip to content

DSL dependency analysis should detect delegate components inside master: URIs #6830

Description

@hxxxi-malog

Requirement

Background

The deprecated master trait has been removed (#6807). Besides creating the RBAC and configuring the cluster service, the trait used to perform one more hidden task: it parsed master:<lockName>:<delegate-scheme>[:...] URIs found in the routes and automatically added the wrapped component to the Integration dependencies (see the removed findAdditionalDependencies() in pkg/trait/master.go, including consumer dependency IDs).

Current behavior

When parsing the DSL, the dependency analysis only recognizes the outer master scheme for a URI such as:

from("master:lock:timer:tick")

The wrapped timer component is not detected, so its dependency is not added to the kit. Users migrating to the properties-based leader election must remember to declare the delegate component manually (e.g. -d camel:timer), otherwise the Integration fails at startup with a confusing error:

Failed to create route ... because: No endpoint could be found for: timer://tick,
please check your classpath contains the needed Camel component jar.

Expected behavior

Dependency detection should unwrap master:<lockName>:<delegate-scheme>[:...] endpoints during DSL parsing and add the delegate component dependency automatically, as already done for regular components. The removed trait logic (findAdditionalDependencies() + CamelCatalog.GetArtifactByScheme() + GetConsumerDependencyIDs()) can serve as a reference implementation.

How to reproduce

Run an Integration with from("master:lock:timer:tick") declaring only -d camel:kubernetes and the quarkus.camel.cluster.kubernetes.* properties: the pod never becomes ready with the error above. e2e/common/traits/master_test.go currently works around this by declaring -d camel:timer explicitly.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDoes not require full understanding of the codebasekind/featureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions