fsrv-xyz opened a new issue, #5933:
URL: https://github.com/apache/camel-k/issues/5933

   ### What happened?
   
   While trying to convert my integration project to `Integration` resources 
via the `kamel run -o yaml` executable, I noticed that it is not possible to 
define the sources of the integration exclusively via the configuration file.
   That means that I need to pass at least one of the sources file as command 
line argument.
   
   As a result of specifying a source file in command line arguments as well as 
in configuration file, the source block is duplicated in the resulting 
integration resource (which is expected, I guess).
   
   ### Steps to reproduce
   
   1. Create a basic integration source file with `camel init hello.java`
   2. Create a `kamel-config.yaml` including a minimal set of configuration:
   ```
   kamel:
     run:
       integration:
         hello:
           sources:
             - ./hello.java
   ```
   3. Run `kamel run -o yaml --name hello`
   The command fails as no source files are specified in command line args.
   
   ### Relevant log output
   
   ```shell
   /private/tmp/test > camel init hello.java
   /private/tmp/test > cat ./kamel-config.yaml
   kamel:
     run:
       integration:
         hello:
           sources:
             - ./hello.java
   /private/tmp/test > kamel run -o yaml --name hello
   Error: run command expects either an Integration source or the container 
image (via --image argument)
   /private/tmp/test > kamel run -o yaml --name hello ./hello.java
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     annotations:
       camel.apache.org/operator.id: camel-k
     creationTimestamp: null
     name: hello
   spec:
     sources:
     - content: |
         import org.apache.camel.builder.RouteBuilder;
   
         public class hello extends RouteBuilder {
   
             @Override
             public void configure() throws Exception {
                 from("timer:java?period=1000")
                     .setBody()
                         .simple("Hello Camel from ${routeId}")
                     .log("${body}");
             }
         }
       name: hello.java
     - content: |
         import org.apache.camel.builder.RouteBuilder;
   
         public class hello extends RouteBuilder {
   
             @Override
             public void configure() throws Exception {
                 from("timer:java?period=1000")
                     .setBody()
                         .simple("Hello Camel from ${routeId}")
                     .log("${body}");
             }
         }
       name: hello.java
     traits: {}
   status: {}
   ```
   
   
   ### Camel K version
   
   v2.5.0


-- 
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