Skip to content

Fix kubernetes runner timeout when the image name is invalid

What does this MR do?

This adds the "InvalidImageName" container waiting state to the "image pull failed" code path, so that invalid image names are 1.) detected and 2.) considered as failed image pulls, so that the job does not wait for the job timeout for failure.

Why was this MR needed?

There is no validation for docker image names in gitlab (until gitlab!34179 (closed) at least), so image name validation is always on the runner side. The docker-runner reports this failure mode when sending the command to the docker daemon (and the docker daemon returns an error), but kubernetes does not fail until the pod is actually scheduled, and there is (until this merge request) no detection for this failure mode.

Are there points in the code the reviewer needs to double check?

None to my knowledge.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

gitlab#220915

Closes #26305 (closed)

Edited by Georgi N. Georgiev

Merge request reports