Merged
Conversation
…al args for Exec function. This prevents the function signature getting too long.
…ronment variables will be available to the programs run by the command.
34f5fa7 to
7879c84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Passing environment variables to commands in the run section of a Bravefile currently has to be done using shell commands (
sh -c 'TEST_VAR="test" ...'). Relying on the shell is not ideal and leans into an imperative style of programming, rather than the declarative style of the rest of the Bravefile.The LXD client provides official support for passing environment variables to
execcommands, which works reliably and with minimal changes to the code. A small extension to the Bravefile's command to include an "env" field that exposes this would allow for an easy, declarative way to pass env variables to commands that does not involve spinning up a shell process.Additionally, being able to avoid the
shcommand tends to make the intent of the command clearer - see the example below.Before:
After: