kubedock icon indicating copy to clipboard operation
kubedock copied to clipboard

Kubedock return 0 status code even when the pod is being evicted

Open jonesbusy opened this issue 1 year ago • 1 comments

Hi,

Not sure if it's the normal behavior to return 0 status code in some cases.

When investigate and fixing an issue on the Jenkins Kubernetes plugin I found that the kubedock container was one of the container to return a 0 Completed status code

For reference : https://github.com/jenkinsci/kubernetes-plugin/pull/1582#event-13331898128

For example for a pod containing multiple container including kubedock

[14:14:37.130+02:00] - - flux -- terminated (137)
[14:14:37.130+02:00] - -----Logs-------------
[14:14:37.130+02:00] - - jf -- terminated (137)
[14:14:37.130+02:00] - -----Logs-------------
[14:14:37.130+02:00] - - jnlp -- terminated (143)
[14:14:37.130+02:00] - -----Logs-------------
[14:14:37.130+02:00] - - kubedock -- terminated (0)
[14:14:37.130+02:00] - -----Logs-------------
[14:14:37.130+02:00] - - maven -- terminated (137)
[14:14:37.130+02:00] - -----Logs-------------
[14:14:37.130+02:00] - - oc -- terminated (137)
[14:14:37.130+02:00] - -----Logs-------------

I understand that kubedock is doing some cleanup in such case but shouldn't the exit code be different on such terminaison ?

[16:52:28.588+02:00] - I0628 14:51:57.755942       1 main.go:212] exit signal recieved, removing pods, configmaps and services

Thanks

jonesbusy avatar Jun 28 '24 15:06 jonesbusy

Definitely makes sense to return a different error code based on the signal. Do you know if there is a standardized mapping I can follow?

This is where the ezit handler is implemented: https://github.com/joyrex2001/kubedock/blob/master/internal/main.go#L203

joyrex2001 avatar Jul 01 '24 07:07 joyrex2001

Pushed a change that will return an exit code based on the received signal. In this case the exit code would be 143.

joyrex2001 avatar Jul 23 '24 18:07 joyrex2001

Thank you very much for the fix!

jonesbusy avatar Jul 25 '24 10:07 jonesbusy