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.
What this PR does / why we need it:
Fixes the garden exec command, which wasn't working when given more than two arguments e.g.
garden exec backend "ls -la"
would fail with executable file not found, whilegarden exec backend ls
succeeds. If not quoting the command with two arguments, garden would interpret the-la
as a garden argument and fail as well.This PR restores the behavior for the command argument as it was in 0.12.x which means that commands are getting split which still fails in cases where there are quoted substrings see #2957.
It also introduces the option to use
--
as a separator to specify commands the same way kubectl does it. Using the--
separator results in quoted strings to be interpreted as one argument.e.g.:
garden exec debian -- /bin/sh -c echo "hello world"
Adding a deprecation warning for using the command argument without the
--
separator.Which issue(s) this PR fixes:
Fixes #2957
Special notes for your reviewer: