Skip to content

Conversation

@vipul-21
Copy link
Contributor

Update the exit code when we see an error in executing a cmd in the shell.

@vipul-21 vipul-21 requested a review from a team as a code owner December 17, 2025 16:22
@vipul-21 vipul-21 requested review from pippolo84 and removed request for a team December 17, 2025 16:22
@vipul-21
Copy link
Contributor Author

cc: @joamaki

If the script command fails propagate the status with
an error marker that is sent instead of the command end
marker and use this to return an error in ShellExchange.

With this the non-interactive use of the shell will exit
with non-zero exit status on command failure, e.g.
"cilium-agent shell -- unknown command" will exit with status 1.

Signed-off-by: Vipul Singh <singhvipul@microsoft.com>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki
Copy link
Contributor

joamaki commented Dec 19, 2025

This was missing the propagation of the failure. Fixed this by adding a new marker (<<error>>) that the server sends when the command fails. Added test cases to check that it's correctly handled.

@joamaki joamaki merged commit 89ccf80 into cilium:main Dec 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants