You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "fsrv-xyz (via GitHub)" <gi...@apache.org> on 2024/11/08 07:20:24 UTC
[I] Do not fail if sources are exclusively passed via configuration file. [camel-k]
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-unsubscribe@camel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Do not fail if sources are exclusively passed via configuration file. [camel-k]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez closed issue #5933: Do not fail if sources are exclusively passed via configuration file.
URL: https://github.com/apache/camel-k/issues/5933
--
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: [I] Do not fail if sources are exclusively passed via configuration file. [camel-k]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #5933:
URL: https://github.com/apache/camel-k/issues/5933#issuecomment-2466094558
Thanks for reporting. I'll have a look at the PR asap.
--
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