Add a separate failure reason for image pull failures
Description
One of our customers (internal) reported that failed pull images are marked as script_failure
. However, based on our descriptions here, script_failure
should only be used if the script defined in the .gitlab-ci.yml
file failed.
This makes it difficult for them to use the retry
keyword when retrying the job due to a failed image pull, as this will also retry their job if the script failed.
Steps to reproduce
I created a test project here: https://gitlab.com/jdasmarinas/zd-326066/-/jobs/3045919061
test:
image: nonexistent/docker-image:non-existent
script:
- ls
Then if you look at the job API, you will notice that failure_reason
is set to script_failure
.
Proposal
We should have a dedicated failure reason for image pull failures. As of right now, we don't have a reliable way to identify image pull failures from actual script failure, which makes it tricky to only retry the job if there was an issue pulling the image.