Skip to content

Implement allowed_pull_policies in config.toml

Furkan Ayhan requested to merge 26753-allowed_pull_policies into main

Steps

Step Status
1. Runner: Implement allowed_pull_policies in config.toml 👈 You are here
2. Runner: Implement supporting pull_policy from jobs !3412 (merged)
3. GitLab: Add pull-policy support for images gitlab!85588 (merged)
4. Runner: Add image pull-policy support to services !3488 (closed)
5. GitLab: Add pull-policy support for service images on CI config gitlab!90136 (merged)
6. Runner: Add the pull-policy from jobs support to Kubernetes !3504 (merged)

What does this MR do?

The allowed_pull_policies config is used for restricting the pull policies of images defined in the GitLab CI config. This will be used mainly when pull_policy is supported by the GitLab CI config (gitlab#21619 (closed)).

Related to: #26753 (closed)

Example

Runner config;

[[runners]]
  name = "shared docker runner 1"
  url = "http://gdk.test:3000/"
  token = "-xyz-"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "alpine"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    allowed_pull_policies = ["never"]

CI Config;

image:
  name: ruby:2.7.6-alpine

test:
  script: ruby -v
  tags: [docker]

Result;

Screen_Shot_2022-05-22_at_23.07.13

Edited by Furkan Ayhan

Merge request reports