[Transient] Inconsistent behavior with pulling runner-helper image when pull_policy is restricted
Summary
There is a test case where we set in runner configuration only to allow never policy with allowed_pull_policies = [never] . Then we would try to apply pull_policy: [always] in CI configuration with expectation that the job would fail with indication that this policy is not allowed.
Most of the time the job would have no problem trying to pull runner-helper image.
But sometimes it would failed at trying to pull runner-helper image due to the policy restriction
Steps to reproduce
Since this is a transient behavior, the chance of reproducing is low.
- Register a runner (might need to enable FF
:ci_docker_image_pull_policyif testing happens before the flag is removed) - Update runner's configuration to only allow
neverpolicy in/etc/gitlab-runner/config.toml - Create CI yml with
pull_policy: [always] - Visit the pipeline and test job (the job should fail) and observe the error message in job log.
Example Project
What is the current bug behavior?
Sometimes the job had no problem pulling runner-helper image, sometimes the pulling attempt was restricted.
What is the expected correct behavior?
I'm not sure, one scenario needs to be decided and should happens consistently - on going discussion https://gitlab.slack.com/archives/CBQ76ND6W/p1661415704071729
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)

