Closed mattwarenski closed 11 months ago
I believe we should not split at all, but allow using --
to provide multiple parameters, similar to how kubectl works:
% kubectl exec -it x -- "ls -lah"
OCI runtime exec failed: exec failed: unable to start container process: exec: "ls -lah": executable file not found in $PATH: unknown
command terminated with exit code 126
% kubectl exec -it x -- ls -lah
total 8K
drwxr-xr-x 1 root root 86 Oct 16 18:17 .
drwxr-xr-x 1 root root 86 Oct 16 18:17 ..
In Bonsai, this doesn't work with the command arguments at all. So running this will fail altogether:
garden exec <pod-name> ls -la
garden exec <pod-name> "/bin/sh -c ls"
Bug
Current Behavior
Running
garden exec api '/usr/bin/env -v echo "hello world"'
gives this output:In the above example "hello" and "world" are being passed as two separate arguments even though they are quoted.
Expected behavior
Running
garden exec api '/usr/bin/env -v echo "hello world"'
should match the output ofkubectl exec pod -- /usr/bin/env -v echo "hello world"
In this example "hello world" is passed as a single argument.
Your environment
The examples were generated running on mac os with garden
0.12.40