-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Remote exec always reports exit code of 0 #346
Comments
I'd like to take a stab at fixing this myself. |
sorenisanerd
added a commit
to sorenisanerd/consul
that referenced
this issue
Sep 17, 2014
Arguments to defer statements are evaluated when the defer statement is evaluated, so pass exitCode by reference instead. Fixes issue hashicorp#346
Is it ok to close this issue or would you rather wait until the patch is included in a release? |
We can close it! |
duckhan
pushed a commit
to duckhan/consul
that referenced
this issue
Oct 24, 2021
duckhan
pushed a commit
to duckhan/consul
that referenced
this issue
Oct 24, 2021
* Add support for L4 service-intentions config entry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No matter what command I execute, consul always reports back that it got exit code 0.
In command/agent/remote_exec.go around line 140, there's this:
The intent is probably that when handleRemoteExec returns, remoteExecWriteExitCode is meant to be run with whatever is the current value of the exitCode variable, but according to the golang docs, exitCode is evaluated when the defer statement is evaluated.
The text was updated successfully, but these errors were encountered: