-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to configure kamel CLI with env vars and configuration files #1133
Conversation
I still need to work on proper unit test but that would require a major refactor of how we create commands so for the moment it would be nice if anyone can test this PR an report any misbehaviour. |
@lburgazzoli Ah! actually I have that refactor almost done in some stashed commit locally... based on a years-old camel-k ... |
Question about:
Does that apply to everything? E.g if I want to apply a set of environment variables to my integration via the The singular version works:
The plural version does not:
That's seems a bug as it is supposed to be working. It may be an issue as the plural form is computed and maybe not working for that, will have a look. In any case the singular version is always there but does not look very nice for multi val flags |
A different thing (nice to have?) would be to have a named config for each runnable integration, like:
|
that would be much more complex as you'd need to determine first the name of the integration which is itself something you can grab from env or file. maybe I can add en env var to control a sort of prefix/profile |
@jamesnetherton your issues should be fixed now |
1b25122
to
00d14b2
Compare
preventing testability and possibly causing some unwanted effects in some scenarios like loading commands configs/flags from env vars and config files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finally LGTM!
Fixes #1108
You can now configure default values for any
kamel
command in a file named.kamel/config.yaml
in the current working directory or in the user home like:Environment variables can be used to so the configuration below can be replaced by:
You can of course mix command flags, environment variables and configuration files (in the given order of priority).
Note that inside a configuration file or environment variables, multi value flags are expressed through the plural for of the flag, as example:
is equivalent to
Release Note