Add lifecycle pre-stop command to gracefully terminate task agent on shutdown
Ensure all Task lifecycle step events can be sent, even on shutdown of the agent and the context is cancelled
Don’t delete the task pod if task agent is still running
This is related to issue https://github.com/kubernetes/client-go/issues/724. The remotecommand package may not always handle network disconnects on the exec command, returning a nil error. Therefore, we don’t delete the task pod in this case, giving a chance for the task to complete in an “orphaned” state.
Prevent Task lifecycle step output from being lost during long-running jobs
Improve task cleanup liveness check robustness and add extra logging
Fix draining and cleanup of a task on shutdown of the runner agent
Use stricter task pod config parsing with more helpful error messaging