I recently switched from the legacy Kubernetes support in the main Drone app to the new drone-runner-kube and at that point I always started getting ‘success’ for DRONE_BUILD_STATUS despite a prior step (actually always the immediate prior step) failing.
I have this as my final step in a pipeline so that it can perform a few housekeeping actions responding to the status.
this is a known difference with the kubernetes runtime that requires a workaround. The pipeline containers are created at the same time, in the same pod. This impacts the status variables because pod environment variables are immutable, and cannot be updated to reflect the updated state of the pipeline. To workaround this, the runner writes the environment variables to a file [1] using the kubernetes downward API which you can then source to get the most up-to-date values [2].