Really silence error when `exec`ing on container that does not exists
Because docker error types are in fact interfaces with a unique identifying method, it's not possible to use errors.Is
or errors.As
on them. And because we wrap those errors as they are returned up the chain, we can't use errdefs
directly. Do this instead.
Fixes #37329 (comment 1793492722)
How To test
Run any type of successful job using a docker executor. Without this fix you should see the following in the runner logs:
`WARNING: Failed to exec create to container: Error response from daemon: can only create exec sessions on running containers: container state improper (docker.go:1312:0s) error=Error response from daemon: can only create exec sessions on running containers: container state improper (docker.go:1312:0s) runner=JePc-w4N`
With the fix you should not see that log.
Edited by Axel von Bertoldi