lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1472967444
##########
pkg/trait/trait_types.go:
##########
@@ -435,51 +434,8 @@ func (e *Environment) addSourcesProperties() {
if e.ApplicationProperties == nil {
e.ApplicationProperties = make(map[string]string)
}
- idx := 0
- for _, s := range e.Integration.AllSources() {
- // We don't process routes embedded (native) or Kamelets
- if e.isEmbedded(s) || s.IsGeneratedFromKamelet() {
- continue
- }
- srcName := strings.TrimPrefix(filepath.ToSlash(s.Name), "/")
- src := "file:" +
path.Join(filepath.ToSlash(camel.SourcesMountPath), srcName)
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].location", idx)] = src
-
- simpleName := srcName
- if strings.Contains(srcName, ".") {
- simpleName = srcName[0:strings.Index(srcName, ".")]
- }
- e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].name",
idx)] = simpleName
-
- for pid, p := range s.PropertyNames {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].property-names[%d]",
idx, pid)] = p
- }
-
- if s.Type != "" {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].type", idx)] =
string(s.Type)
- }
- if s.InferLanguage() != "" {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].language", idx)] =
string(s.InferLanguage())
- }
- if s.Loader != "" {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].loader", idx)] =
s.Loader
- }
- if s.Compression {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].compressed", idx)] =
"true"
- }
-
- interceptors := make([]string, 0, len(s.Interceptors))
- if s.Interceptors != nil {
- interceptors = append(interceptors, s.Interceptors...)
- }
- if e.Interceptors != nil {
- interceptors = append(interceptors, e.Interceptors...)
- }
- for intID, interceptor := range interceptors {
-
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].interceptors[%d]",
idx, intID)] = interceptor
- }
- idx++
- }
+ e.ApplicationProperties["camel.main.source-location-enabled"] = "true"
+ e.ApplicationProperties["camel.main.routes-include-pattern"] =
fmt.Sprintf("file:%s/**", camel.SourcesMountPath)
Review Comment:
this is likely not working as expected as the interceptors then won't work.
also some interceptors are per routes so the general route discovery is
likely not enough
some work must be done on the camel side before using this approach. this is
essential the reason why there is still a camel-k extension in camel-quarkus at
this stage.
--
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]