kubernetes executor: timedout waiting for pod to start, does not delete the pod
Summary
If the pod does not enter running state after a time period, it will exit the build with ERROR: Build failed (system failure): timedout waiting for pod to start
but it won't delete the pod. The executor should delete build pods if they fail to schedule.
Steps to reproduce
Create a runner with kubernetes executor, set resource request settings, so the pod will not fit on any node, run a build.
Actual behavior
Executor exits with ERROR: Build failed (system failure): timedout waiting for pod to start
but does not remove the pod. If the pod is scheduled at a later time, it is left in running state and never exits.
Expected behavior
If build pod fails to schedule, the pod should get deleted.
Relevant logs and/or screenshots
There are no logs from the build or helper container in the build pod.
Environment description
Custom installation version 8.15.4
Used GitLab Runner version
gitlab-runner --version
Version: 1.10.6
Git revision: 2dadd48
Git branch: 1-10-stable
GO version: go1.7.5
Built: Tue, 21 Feb 2017 23:47:36 +0000
The code the timeout error comes from: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/executors/kubernetes/util.go#L169