apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
868 stars 349 forks source link

fix(cli): allow specifying integration run sources exclusively via config file #5930

Closed fsrv-xyz closed 1 week ago

fsrv-xyz commented 2 weeks ago

Hey there!

Thank you for doing such awesome work with that project.

While using the kamel tool, I tried to exclusively configure my deployment via the kamel-config.yaml file. Due to there is a sources array in that config file, I think specifying the sources there should be enough to run an integration rather than needing to define at least one source at kamel run [file to run].

My patch skips the error if no source file is provided via arguments and at least one source is provided in the configuration file. Otherwise, there will be an error if the sources are only provided in config file.

fsrv-xyz commented 2 weeks ago

I opened an issue at https://github.com/apache/camel-k/issues/5933 to keep track of this. Thank you for checking.

fsrv-xyz commented 1 week ago

@squakez Thank you for your review. The behavior you described was related to an error on my end where an empty sources list passed the check. I fixed that in https://github.com/apache/camel-k/pull/5930/commits/b041f17be45e943410ebe57d5a478be67ea92c96.

I also checked your mention of the "config profile" part. While I am not 100% sure what you mean by that (especially its impact on the sources), I guess it is the deprecation you introduced in https://github.com/apache/camel-k/pull/5871. While browsing the docs for that, I could not identify a way of manipulating the source file selection with IntegrationProfiles. Please enlighten me if I have overlooked something.

squakez commented 1 week ago

Thanks for the contribution!