Steps to reproduce:
pipeline{ agent { label "test-pod" } stages { stage("Sleep") { steps { sh "sleep 1000" } } } }
Result:
SlaveComputer is marked as offline and never get deleted even after we delete the pod. Build will also not failed and run forever.
Expected Result:
SlaveComputer is deleted and the build is failed.
I have looked at the codes.
After the channel is closed, SlaveComputer will call `afterDisconnect` to notify KubernetesLaunch https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/slaves/SlaveComputer.java#L625. But KubernetesLaunch didn't implement this method. Maybe we need to implement `afterDisconnect` method to clean up SlaveComputer after the channel is closed?
Hmm, this is supposed to have been addressed by a patch towards JENKINS-49707. See test case. Can you check with fine logging on org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper?