gansheer opened a new issue, #5372:
URL: https://github.com/apache/camel-k/issues/5372

   ### What happened?
   
   When working with the following topology:
   * a global operator
   * an integration in a namespace different than the one where the Camel K 
operator pod is installed using a maven profile from a configmap/secret defined 
in the integration namespace
   the build is in error because it expects to find the configmap/secret 
containing the maven profile in the namespace where the operator is deployed.
   
   In a way it make sense that this behavior is applied since the maven-profile 
is a build parameter and the build is done by the Camel K operator. At the same 
time, in theory, when a user creates its own integration he should not need to 
access the operator namespace.
   
   Which bring the real issue: shoud the user be able to build a Camel K 
Integration project defining its own maven profile and declare it or should we 
expect the build parameters to only use maven-profiles pre-created?
   
   Note: This issue is also valid for this feature : 
https://github.com/apache/camel-k/issues/4639
   
   ### Steps to reproduce
   
   1. Install the Camel K operator as global: `kamel install --global -n 
camel-k`
   2. Create a user namespace: `kubectl create namespace user1`
   3. Create a configmap containing a profile in the user namespace: `kubectl 
create configmap maven-profile-dependency 
--from-file=[path]/dependency-profile.xml -n user1`
   4. Run an integration in the user namespace: `kamel run Test.java -t 
builder.maven-profiles=configmap:maven-profile-dependency/dependency-profile.xml
 -n user1`
   
   ### Relevant log output
   
   ```shell
   amel-k-operator-d4bc654cc-8cj25 camel-k-operator 
{"level":"info","ts":"2024-04-15T13:42:08Z","logger":"camel-k.controller.build","msg":"Build
 duration 
301.071971ms","request-namespace":"user1","request-name":"test","build-attempt":0,"build-result":"Failed","build-duration":0.301071971,"api-version":"camel.apache.org/v1","kind":"Build","ns":"camel-k","name":"kit-coeitc77nc44koqlsgn0"}
   camel-k-operator-d4bc654cc-8cj25 camel-k-operator 
{"level":"error","ts":"2024-04-15T13:42:08Z","logger":"camel-k.controller.build","msg":"Build
 kit-coeitc77nc44koqlsgn0 failed: could not load profile : 
configmap:maven-profile-dependency/dependency-profile.xml: ConfigMap 
\"maven-profile-dependency\" not found. 
","request-namespace":"camel-k","request-name":"kit-coeitc77nc44koqlsgn0","api-version":"camel.apache.org/v1","kind":"Build","ns":"camel-k","name":"kit-coeitc77nc44koqlsgn0","stacktrace":"github.com/apache/camel-k/v2/pkg/util/log.Logger.Errorf\n\tgithub.com/apache/camel-k/v2/pkg/util/log/log.go:66\ngithub.com/apache/camel-k/v2/pkg/controller/build.(*monitorRoutineAction).updateBuildStatus\n\tgithub.com/apache/camel-k/v2/pkg/controller/build/monitor_routine.go:216\ngithub.com/apache/camel-k/v2/pkg/controller/build.(*monitorRoutineAction).runBuild\n\tgithub.com/apache/camel-k/v2/pkg/controller/build/monitor_routine.go:200"}
   ```
   
   
   ### Camel K version
   
   main, 2.3.x


-- 
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-unsubscr...@camel.apache.org.apache.org

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

Reply via email to