Environment variables evaluated only at integration runtime #1916
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds a way to pass environment variables that only get resolved at integration runtime.
These values can be passed as modeline options in this way:
This allows images built locally with
kamel local create
to be deployed in the cloud. If the image depends on any such environment variables, their value needs to be resolved in the deployment script. This ensures that the same modeline option that is provided locally works when run in the cloud environment.Moreover it provides a safe way to pass sensitive properties such as web hooks. The value of
{{env:SLACK_WEBHOOK}}
will only become available when the integrations is run. The value will be taken from the parent environment which is either the local machine or a container.For the case when the parent environment is a container, this patch also adds an
--env
flag tokamel local run
. Previously to run an existing image, it was sufficient to provide the image name:This still holds if no delayed environment variables are used as modeline options.
If delayed environment variables such as {{env:KAFKA_BROKERS}} are used then the
kamel local run
command needs to also provide values for these variables:(This is similar to what a
docker run
command would require)Release Note