You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ kurtosis enclave add --name test-enclave
$ kurtosis service add test-enclave test2 httpd --ports http=80
$ kurtosis service shell test-enclave test2 --exec "exit 1"
echo $? # prints 0
This is critical for usage in CI systems that check exit code to report failure
Desired behavior
echo $? should print 1
This behavior happens because we use GetConnectionWithUserService to act both as a attach terminal and as an exec with the param commandToRunInsteadOfBash.
I believe GetConnectionWithUserService should be reserved for interactive operations, since we are attaching a connection. So getting an interactive shell or even some interactive programs like cat (equivalent to -it flag in Docker)
For non interactive ones, like echo, could simply use RunUserServiceExecCommands when running kurtosis service shell ... --exec ..., since that command and blocking, and returns all information about the program execution (return status), but does not offer interactivity (maybe kurtosis service exec to match Dockers terminology?)
What is the severity of this bug?
Critical; I am blocked and Kurtosis is unusable for me because of this bug.
The text was updated successfully, but these errors were encountered:
## Description:
Users can now run `kurtosis service exec <ENCLAVE_ID> <SERVICE_ID> 'any
sh command'`. The command will be executed inside the designated user
service and the result will be printed in the CLI output.
The main different with `kurtosis service shell <ENCLAVE_ID>
<SERVICE_ID> --exec 'any sh command'` is that the former expects a zero
exit code for the command otherwise throws an exception, whereas the
latter returns gracefully whatever the exit code of the command was.
In short, `kurtosis service shell` is designed for interactive sessions
and will always return gracefully as long as the session terminated is
ended successfully. `kurtosis service exec` provides a way to run a
single command and returns immediately, taking the status of the command
into account.
Fixes#688
## Is this change user facing?
YES
<!-- If yes, please add the "user facing" label to the PR -->
<!-- If yes, don't forget to include docs changes where relevant -->
## References (if applicable):
<!-- Add relevant Github Issues, Discord threads, or other helpful
information. -->
What's your CLI version?
0.77.0
Description & steps to reproduce
This is critical for usage in CI systems that check exit code to report failure
Desired behavior
echo $?
should print 1This behavior happens because we use
GetConnectionWithUserService
to act both as a attach terminal and as an exec with the paramcommandToRunInsteadOfBash
.kurtosis/container-engine-lib/lib/backend_interface/kurtosis_backend.go
Line 271 in 68a1ad1
I believe
GetConnectionWithUserService
should be reserved for interactive operations, since we are attaching a connection. So getting an interactive shell or even some interactive programs likecat
(equivalent to-it
flag in Docker)For non interactive ones, like
echo
, could simply useRunUserServiceExecCommands
when runningkurtosis service shell ... --exec ...
, since that command and blocking, and returns all information about the program execution (return status), but does not offer interactivity (maybekurtosis service exec
to match Dockers terminology?)What is the severity of this bug?
Critical; I am blocked and Kurtosis is unusable for me because of this bug.
The text was updated successfully, but these errors were encountered: