Allow pull_policy to be unset when defining allowed_pull_policies

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do?

Allow pull_policy to be unset when defining allowed_pull_policies

Why was this MR needed?

Setting allowed_pull_policies in a runners config.toml and not setting pull_policy in either the runner config or a .gitlab-ci.yml causes the job to fail stating the pull_policy is not allowed. That pull_policy being an empty string since it was never set.

What's the best way to test this MR?

Configure a runner to have allowed_pull_policies = ["always", "if-not-present", "never"] and do not set pull_policy on it
Run a job on this runner without setting image.pull_policy
The job should be allowed to run instead of failing with a message stating that the pull_policy([]) is not in allowed_pull_policies(["Always" "IfNotPresent" "Never"])

What are the relevant issue numbers?

Edited by Axel von Bertoldi

Merge request reports

Loading