Gitlab Runner does not respect allowed_pull_policies
Summary
The runner does not allow to change other pull policy different than always. I am using the 0.58.1 version of the helmchart, and the helm template is fine.
Steps to reproduce
.gitlab-ci.yml
stages:
- build
- test
build:
stage: build
tags:
- mycustomrunner
image:
name: gcr.io/kaniko-project/executor:v1.17.0-debug
entrypoint: [""]
pull_policy: always
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--build-arg PACKAGE_REGISTRY_TOKEN="${PACKAGE_REGISTRY_TOKEN}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}"
only:
changes:
- sof_analysis.py
- startup.sh
build_test_runner:
stage: build
tags:
- mycustomrunner
image:
name: gcr.io/kaniko-project/executor:v1.17.0-debug
entrypoint: [""]
pull_policy: if-not-present
script:
- echo "SOF batch process test runner image"
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--build-arg PACKAGE_REGISTRY_TOKEN="${PACKAGE_REGISTRY_TOKEN}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile_testrunner"
--destination "${CI_REGISTRY_IMAGE}/testrunner:${CI_COMMIT_REF_SLUG}"
only:
changes:
- Dockerfile_testrunner
- test_ci.sh
test:
stage: test
tags:
- myustomrunner
image:
name: registry.gitlab.com/etc
pull_policy: if-not-present
script:
- ./test_ci.sh
Actual behavior
The pipeline crash if the pull_policy is not always.
Expected behavior
The pipeline must work in if-not-present
Relevant logs and/or screenshots
job log
2023-11-02T12:37:40.939488571Z ERROR: Job failed (system failure): failed to pull image 'registry.gitlab.com/etc: pull_policy ([IfNotPresent]) defined in GitLab pipeline config is not one of the allowed_pull_policies ([])
Environment description
config.toml contents
runners:
secret: secret
privileged: true
config: |
[[runners]]
[runners.docker]
allowed_pull_policies = ["always", "if-not-present"]
Used GitLab Runner version
alpine-v16.5.0