Implement improved JSON termination mode for Kubernetes
What does this MR do?
- Fixes an issue where certain PowerShell scripts have a succesful result, even though their exit code indicated otherwise.
- Updates the Bash trap shell, so that the
Finish()
script between PowerShell and Bash is more closely matched and easier to follow.
Why was this MR needed?
Using Powershell's trap
only worked in a handful of cases. It's easier to detect errors correctly if we execute the script and then check the value returned.
What's the best way to test this MR?
There's 2 integration tests added for both Bash and Powershell. The Powershell has edge cases that will fail with the previous implementation.
The test-cases are also a good reference for executing a problematic job manually (Exit 128
in a script, for example).
What are the relevant issue numbers?
Closes #28094 (closed)
Closes #28218 (closed)
Closes #28440 (closed)
Edited by Arran Walker