Drone-runner-kube and exit code 2

When my drone steps exit with status code 2 (very common if there is an error in a makefile: make returns exit status 2 on most failures), I cannot see any output in the drone UI, it only shows an error message in red with e.g.

kubernetes has failed: container failed to start: id=drone-2a0931gy1k74zhsfbuuo exitcode=2 reason=Error image=example.com/myimage:latest

I believe this is due to this check: drone-runner-kube/watcher.go at 83138d906b599fb7ec5bd9445215a0770e3cd2e6 · drone-runners/drone-runner-kube · GitHub

Hello @james-callahan

It would be great if you can give us as much detail as possible as described in How to ask for help

The Kubernetes runner is still in beta, so there are still bugs. The more information you can give us, the more likely we will be able to reproduce the issue.


@james-callahan it looks like that change was introduced in v1.0.0-rc.2, can you try v1.0.0-rc.1 and/or v1.0.0-beta.12 and see if the problem reproduces?

I agree, it seems strange to catch a specific exit code.


Not easily: we only have a single drone-kube-runner set up and I can’t roll it back without impacting our engineers.

But given we can directly see the line of code that gives the undesired outcome… lets fix it?