You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "squakez (via GitHub)" <gi...@apache.org> on 2024/01/23 13:58:27 UTC

[PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

squakez opened a new pull request, #5090:
URL: https://github.com/apache/camel-k/pull/5090

   <!-- Description -->
   
   Requires still some work to be fully functional, but it should give an idea where to head the new design.
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   NONE
   ```
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1957413739

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.6% (**+1.8%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1964077445

   @squakez I've created a [draft PR](https://github.com/apache/camel-quarkus/pull/5802) here to clean up the camel-k extension that exists in camel-quarkus, once merged you should be able to leverage overrides, like:
   
   ```properties
   camel.k.routes.overrides[0].input.from = direct:r1
   camel.k.routes.overrides[0].input.with = direct:r1override
   ```
   
   To replace cron's workaround.
   
   It also enhance properties discovery and loading so you can probably remove the custom property discovery mechanism that has been implemented here. As as side note, implementing https://github.com/apache/camel-k/issues/5181 could probably help improving camel-k configuration handling.
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1908449216

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 35.8% (**+1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1906127047

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 35.3% (**+0.5%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1921304361

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 36.5% (**+0.9%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1486080395


##########
pkg/trait/cron.go:
##########
@@ -475,3 +479,31 @@ func checkedStringToUint64(str string) uint64 {
 	}
 	return res
 }
+
+// changeSourcesCronURI is in charge to change the value of the from route with a component that executes
+// the workload just once.
+func (t *cronTrait) changeSourcesCronURI(e *Environment) error {

Review Comment:
   Depends on https://github.com/apache/camel-quarkus/issues/5745



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1941660634

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
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



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1473088911


##########
pkg/util/camel/camel_runtime_catalog.go:
##########
@@ -232,3 +230,38 @@ func (c *RuntimeCatalog) IsResolvable(uri string) bool {
 
 	return true
 }
+
+func jolokiaCatalogWorkaround() v1.Capability {

Review Comment:
   It's a workaround. I expect the new catalog to manage those dependencies and the possibility to include the classifier as well. I've already collected as a TODO for when the draft is completed.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1473138363


##########
pkg/util/camel/camel_runtime_catalog.go:
##########
@@ -232,3 +230,38 @@ func (c *RuntimeCatalog) IsResolvable(uri string) bool {
 
 	return true
 }
+
+func jolokiaCatalogWorkaround() v1.Capability {

Review Comment:
   I think both changes should be already released. We are in control of the Jolokia version, so it really does not mind if the Quarkus has a different one. Feel free to go ahead so I can rebase this PR once they are available.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1485984284


##########
pkg/trait/knative.go:
##########
@@ -454,11 +468,23 @@ func (t *knativeTrait) configureSinkBinding(e *Environment, env *knativeapi.Came
 	}
 
 	err := t.withServiceDo(false, e, env, services, serviceType, knativeapi.CamelEndpointKindSink, func(ref *corev1.ObjectReference, serviceURI string, _ func() (*url.URL, error)) error {
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.enabled"] = "true"
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.name"] = ref.Name
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.type"] = string(serviceType)
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.kind"] = ref.Kind
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.api-version"] = ref.APIVersion
+		if e.ApplicationProperties == nil {

Review Comment:
   Once [CAMEL-20400](https://issues.apache.org/jira/browse/CAMEL-20400) will become available, it should be possible to just use properties
   
   ```
   came.component.knative.sink-binding.name = …
   ```
   
   it is also possible to use properties to configure the knative environment (which is also the preferred way), like:
   
   ```
   camel.component.knative.environment.resources[0].type = ...
   camel.component.knative.environment.resources[0].name = ...
   ```



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1909911878

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 35.8% (**+1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1912194307

   understanding how camel-main works, we can see the `camel.main.routesInclude​Pattern` parameter replaces one of key parts of camel-k-runtime which is the ability to dynamically load the routes. My perception is this feature was not mature in camel-core at that time and camel-k-runtime was created to support this feature.
   So, I think this is good, to materialize a camel-quarkus project. Also, there is no need anymore to the [camel-k extension in camel-quarkus](https://github.com/apache/camel-quarkus/tree/main/extensions/camel-k).
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1482837421


##########
pkg/trait/knative.go:
##########
@@ -454,11 +468,23 @@ func (t *knativeTrait) configureSinkBinding(e *Environment, env *knativeapi.Came
 	}
 
 	err := t.withServiceDo(false, e, env, services, serviceType, knativeapi.CamelEndpointKindSink, func(ref *corev1.ObjectReference, serviceURI string, _ func() (*url.URL, error)) error {
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.enabled"] = "true"
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.name"] = ref.Name
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.type"] = string(serviceType)
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.kind"] = ref.Kind
-		e.ApplicationProperties["camel.k.customizer.sinkbinding.api-version"] = ref.APIVersion
+		if e.ApplicationProperties == nil {

Review Comment:
   @lburgazzoli KnativeResource registry binding



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500554671


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())

Review Comment:
   The operator must NOT access to the user's config map/secrets/resources.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500718125


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   given there is a camel-k extension in camel-quarkus, I really don't see the need for this and for computing the list of properties.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500743704


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())

Review Comment:
   No. Not all the cm/secrets are `.properties` file.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez closed pull request #5090: feat(runtime): get rid off camel k runtime dependency - WIP
URL: https://github.com/apache/camel-k/pull/5090


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1482838338


##########
pkg/trait/cron.go:
##########
@@ -475,3 +479,31 @@ func checkedStringToUint64(str string) uint64 {
 	}
 	return res
 }
+
+// changeSourcesCronURI is in charge to change the value of the from route with a component that executes
+// the workload just once.
+func (t *cronTrait) changeSourcesCronURI(e *Environment) error {

Review Comment:
   @lburgazzoli change cron uri (as done by ck-runtime).



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1931703687

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 37.2% (**+1.6%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1930231811

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 36.9% (**+1.3%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1945766758

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1473000784


##########
pkg/util/camel/camel_runtime_catalog.go:
##########
@@ -232,3 +230,38 @@ func (c *RuntimeCatalog) IsResolvable(uri string) bool {
 
 	return true
 }
+
+func jolokiaCatalogWorkaround() v1.Capability {

Review Comment:
   Is this workaround because the jolokia-agent-jvm is resolved from a GAV classifier and not supported in the MavenArtifact struct ? 
   I ask this because, a couple of weeks ago I investigated a jolokia issue and tried jolokia 2.0 in camel-k, but later on I verified camel-quarkus actually uses jolokia 1.7.2, then I parked my changes in Camel K. 
   That investigation led me to add support for a GAV classifier in the MavenArtifact struct and the camel-k-catalog in camel-k-runtime, with the end goal of supporting the GAV classifier.
   If interest I can share this branch.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500722411


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())

Review Comment:
   True. We may rework the feature to let the user explictly specify the cm/secrets holding the properties and deprecate this part for future removal.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1952759852

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 38% (**+2.2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1910297616

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 35.8% (**+1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1908408647

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 35.8% (**+1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1919274030

   camel-k-runtime supports the dynamic reload of a route (no project rebuild) when the parameters are modified, for example, the master trait, if the [resourceName parameter change](https://github.com/apache/camel-k-runtime/blob/main/camel-k-master/impl/src/main/java/org/apache/camel/k/master/MasterContextCustomizer.java#L34) with a `-t master.resource-name=new-foo` , the master trait in camel-k-runtime is backed by camel-master and not [camel-quarkus-kubernetes](https://github.com/apache/camel-quarkus/blob/main/extensions/kubernetes/runtime/src/main/java/org/apache/camel/quarkus/component/kubernetes/cluster/KubernetesClusterServiceConfig.java#L107), so this means that when the user changes the `resource-name` parameter camel-k-runtime just reloads the route, however in camel-quarkus-kubernetes it requires a rebuild of the project due to [`ConfigPhase.BUILD_TIME`](https://quarkus.io/guides/writing-extensions#config-phases).
   
   I think this is fine, as there are only 3 extensions in camel-k-runtime whom are affected by this hot reload feature not available in non dev mode in camel-quarkus.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1946272761

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.9% (**+2.1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1946298675

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.9% (**+2.1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500730105


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())

Review Comment:
   Isn't this already the case ? with mount.configs we know already what config maps/secrets are configuration resources. 



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1933649508

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 37.4% (**+1.8%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1932078270

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 37.2% (**+1.6%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1943579082

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1943694866

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1919372031

   > > hot reload is not what we really want and MUST be disabled
   > 
   > By hot reload I meant the possibility of changing a configuration parameter that doesn't require a maven rebuild, like the master trait example I provided earlier, which just works.
   
   ah ok, I had the impression it was about hot reload of routes which in reality never happens as the pod is restarted


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1952265243

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.9% (**+2.1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500712295


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   Sure. Most of the traits are actually only working with Quarkus (see log trait, master trait, etc). The idea of this first development is to remove the Camel K runtime dependency, and eventually work to make it completely runtime agnostic.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1945979706

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1946149512

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1934690641

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 37.4% (**+1.8%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1929176265

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 36.8% (**+1.2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1941278020

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.7% to 37.7% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1919311788

   > I think this is fine, as there are only 3 extensions in camel-k-runtime whom are affected by this hot reload feature not available in non dev mode in camel-quarkus.
   
   hot reload is not what we really want and MUST be disabled, if something changes, the pod must be restarted otherwise it is gonna be hard to do proper upgrade as things may change and fail out of control.
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1473119164


##########
pkg/util/camel/camel_runtime_catalog.go:
##########
@@ -232,3 +230,38 @@ func (c *RuntimeCatalog) IsResolvable(uri string) bool {
 
 	return true
 }
+
+func jolokiaCatalogWorkaround() v1.Capability {

Review Comment:
   If you want to have a look at the [GAV classifier change](https://github.com/apache/camel-k/commit/f48806818e9b68d6d096030871285c99efcbbcc3) and in [camel-k-runtime](https://github.com/apache/camel-k-runtime/commit/63aed1030d99075ddae06684445903da0ea0707d), but I'm afraid this cannot yet be pushed as camel-quarkus is still in jolokia 1.7.2.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1954007807

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 38% (**+2.2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1959242220

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500712295


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   Sure. Most of the traits are actually only working with Quarkus (see log trait, master trait, jvm etc). The idea of this first development is to remove the Camel K runtime dependency, and eventually work to make it completely runtime agnostic (both in this trait and any other trait).



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1929226901

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 36.8% (**+1.2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1943962811

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500464327


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   We have established a contract for which each runtime (quarkus and in future spring boot and eventually plain camel main) must honor in order to be camel-k compatible which states where the config maps, secrets and resources are projected. 
   
   Given that each runtime has it's own machinery to discover/load properties I think this goes in the wrong direction as implies the operator to have a deep knowledge of the runtime, which we want to avoid.
   
   The operator must only mount config maps, secrets and resources in the expected directories and then leave discovery part to the specific runtime. 



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500712295


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   Sure. Most of the traits are actually only working with Quarkus (see log trait, master trait, etc). The idea of this first development is to remove the Camel K runtime dependency, and eventually work to make it completely runtime agnostic (both in this trait and any other trait).



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1961057814

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.9% (**+2.1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500731359


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   My main goal is reducing the effort on maintaining the software and shortening the release cycle. As I am the one dealing with it with, I am trying to find efficient ways to manage it.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1919360500

   > hot reload is not what we really want and MUST be disabled
   
   By hot reload I meant the possibility of changing a configuration parameter that doesn't require a maven rebuild, like the master trait example I provided earlier, which just works.
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1969242806

   @squakez about the cron job, Once https://github.com/apache/camel-quarkus/pull/5802/ will be available, there is this new camel-k property you can use to gracefully shutdown the application:
   
   ```
   camel.k.shutdown.max-messages = 1
   ```


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1908155395

   @squakez 👍 this looks good to me so far


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1485982086


##########
pkg/trait/cron.go:
##########
@@ -475,3 +479,31 @@ func checkedStringToUint64(str string) uint64 {
 	}
 	return res
 }
+
+// changeSourcesCronURI is in charge to change the value of the from route with a component that executes
+// the workload just once.
+func (t *cronTrait) changeSourcesCronURI(e *Environment) error {

Review Comment:
   so this works my manipulating the source of the given integration which I would like to avoid as it is quite fragile and I rather do it in the underlying runtime but it requires some[ changes on camel-core](https://issues.apache.org/jira/browse/CAMEL-20409) and camel-k quarkus extension/spring boot starter
   
   
   



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1912168386

   :heavy_check_mark: Unit test coverage report - coverage increased from 34.8% to 36.3% (**+1.5%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1921816861

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.6% to 36.6% (**+1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1914543218

   > Also, there is no need anymore to the [camel-k extension in camel-quarkus](https://github.com/apache/camel-quarkus/tree/main/extensions/camel-k).
   
   When I first saw this change, I wondered about that.
   
   Does this mean we could remove the camel-k bits from CQ?
   
   And could that change be done now so that it's complete in time for the next LTS release? AFAIK, camel-k has not consumed the camel-k-runtime extension from CQ yet.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1914749075

   > > Also, there is no need anymore to the [camel-k extension in camel-quarkus](https://github.com/apache/camel-quarkus/tree/main/extensions/camel-k).
   > 
   > When I first saw this change, I wondered about that.
   > 
   > Does this mean we could remove the camel-k bits from CQ?
   > 
   > And could that change be done now so that it's complete in time for the next CQ LTS release? AFAIK, camel-k has not consumed the camel-k-runtime extension from CQ yet.
   
   That's correct. As soon as this development is complete, we can remove the related ck-runtime bits from CQ and in general make the dependency process much smoother. It's possible that however we'll need to include the catalog into CQ or extend the one available there, but it should be done via maven plugin. Not reached yet that part, I expect this development to last still a bit :)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1952193305

   Native checks are failing due to resource shortage in github actions. I'm running the test locally to prove all is good also from Quarkus native standpoint:
   ```
   --- PASS: TestNativeIntegrations (446.57s)
       --- PASS: TestNativeIntegrations/unsupported_integration_source_language (0.74s)
       --- PASS: TestNativeIntegrations/xml_native_support (204.59s)
       --- PASS: TestNativeIntegrations/automatic_rollout_deployment_from_jvm_to_native_kit (231.63s)
           --- PASS: TestNativeIntegrations/automatic_rollout_deployment_from_jvm_to_native_kit/yaml_native_should_not_rebuild (2.18s)
   PASS
   ok  	github.com/apache/camel-k/v2/e2e/native	695.130s
   ``


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1959261575

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.8% (**+2%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#issuecomment-1946468814

   :heavy_check_mark: Unit test coverage report - coverage increased from 35.8% to 37.9% (**+2.1%**)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500747075


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())

Review Comment:
   as far as I remember, it does not matter. 
   The runtime/extensione loads them even if they are not .properties



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(runtime): get rid off camel k runtime dependency - WIP [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5090:
URL: https://github.com/apache/camel-k/pull/5090#discussion_r1500740746


##########
pkg/trait/mount.go:
##########
@@ -165,4 +193,191 @@ func (t *mountTrait) mountResource(vols *[]corev1.Volume, mnts *[]corev1.VolumeM
 
 	*vols = append(*vols, *vol)
 	*mnts = append(*mnts, *mnt)
+
+	// User specified location file (only properties file)
+	if dstDir != "" {
+		if strings.HasSuffix(dstDir, ".properties") {
+			return []string{mntPath}, nil
+		}
+		return nil, nil
+	}
+
+	// We only process this for text configuration .properties files, never for resources
+	if conf.ContentType() == utilResource.ContentTypeText {
+		// the user asked to store the entire resource without specifying any filter
+		// we need to list all the resources belonging to the resource
+		if conf.StorageType() == utilResource.StorageTypeConfigmap {
+			cm := kubernetes.LookupConfigmap(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if cm != nil {
+				for k := range cm.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from configmap.
+						This feature may disappear in future releases, make sure to use properties file in you configmap instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: cm.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		} else if conf.StorageType() == utilResource.StorageTypeSecret {
+			sec := kubernetes.LookupSecret(e.Ctx, e.Client, e.Integration.Namespace, conf.Name())
+			if sec != nil {
+				for k := range sec.Data {
+					if strings.HasSuffix(k, ".properties") {
+						paths = append(paths, fmt.Sprintf("%s/%s", mntPath, k))
+					} else {
+						// Deprecated: use explicit configuration instead
+						envName := strings.ToUpper(strings.ReplaceAll(strings.ReplaceAll(k, "-", "_"), ".", "_"))
+						t.L.Infof(`Deprecation notice: the operator is adding the environment variable %s which will take runtime value from secret.
+						This feature may disappear in future releases, make sure to use properties file in you secret instead.`, envName)
+						propsAsEnv = append(propsAsEnv, corev1.EnvVar{
+							Name: envName,
+							ValueFrom: &corev1.EnvVarSource{
+								SecretKeyRef: &corev1.SecretKeySelector{
+									LocalObjectReference: corev1.LocalObjectReference{
+										Name: sec.Name,
+									},
+									Key: k,
+								},
+							},
+						})
+					}
+				}
+			}
+		}
+	}
+
+	return paths, propsAsEnv
+}
+
+// Configure the list of location which the runtime will look for application.properties files.
+func (t *mountTrait) setConfigLocations(container *corev1.Container, configPaths []string) {
+	if configPaths != nil {
+		envvar.SetVar(&container.Env, corev1.EnvVar{
+			Name:  "QUARKUS_CONFIG_LOCATIONS",

Review Comment:
   Me too, hence I recommend to keep the extension and work across the stack to make the integration smooth



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org