-
Notifications
You must be signed in to change notification settings - Fork 781
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
consul template executing multiple commands using sh -c does not work with 0.25.2 #1456
Comments
Similar behaviour with a simpler command:
Switching to escaped double-quotes doesn't help - the execution always strips the quotes before the command runs. |
Another similar example
Prints an empty line with |
Thanks for the report @pavanrangain and reproducing/confirming this @medains, @krchiper. I've also reproduced this and it is a regression from 0.25.1->0.25.2. Bisecting results in the dependency updates commit (of course); 6213a54 It was the go-shellwords update (v1.0.5->v1.0.10) in that commit that broke things. Going to add a test for this and dig in a bit. |
This issue has already been reported upstream. I've added a comment with this case and a test showing it. mattn/go-shellwords#48 (comment) I'm considering either submitting a PR upstream or reverting our use to an earlier version. Either way I'm going to add some testing of this to help catch these sorts of issues in the future. |
Still not fixed in |
Sorry for the delays @krchiper. I'm trying to get caught up on the PRs first, then will get to the issues. I plan on including this issue in the next release which is what I'm working towards now. |
Was about to file an issue for this same issue. I'm hitting the behaviour with this command instead.
|
I've fixed the issue in go-shellwords and made a PR. Going to switch to my fork temporarily until it is merged upstream and that should allow me to close this issue. |
Consul Template version
Run
consul-template -v
to show the version. If you are notrunning the latest version, please upgrade before submitting an
issue.
Configuration
Expected behavior
We want to make sure that after the certs and key generated its only readable by the intended user and not by any other user. Hence the run the chmod and chown command as given above. We know there is no way to set ownership of the file generated #461
The above command was perfectly working with 0.25.1
Actual behavior
When upgraded to 0.25.2 this command no more works. We see the error below
If we see the second line in the error
sh -c chmod 400 template.pem
it looks like the quotes are removed and command is truncated at the first occurance of && operator. Thus this command becomes invalid and throwing error.Steps to reproduce
The text was updated successfully, but these errors were encountered: