Skip to content

Add support for helper image registry overwrite

Romuald Atchadé requested to merge configure_helper_registry into main

What does this MR do?

It allows the user to specify a custom registry to pull the helper image

Why was this MR needed?

The Runner Helper image is only pulled from the GitLab Runner Helper Registry. With this MR, the ability to configure the helper registry is added to the config.toml file through the addition of helper_image_registry for both Docker and Kubernetes executors.

What's the best way to test this MR?

config.toml
concurrent = 1
check_interval = 1
log_level = "debug"

[session_server]
  session_timeout = 1800

[[runners]]
  request_concurrency = 1
  url = "https://gitlab.com/"
  token = "__REDACTED__"
  executor = "kubernetes"
  [runners.kubernetes]
    image = "alpine:latest"
    helper_image_registry = "docker.io"
    namespace_overwrite_allowed = ""
    privileged = true
    allow_privilege_escalation = true
    service_account_overwrite_allowed = ""
    pod_annotations_overwrite_allowed = ""
    terminationGracePeriodSeconds = 30
    [runners.kubernetes.affinity]
    [runners.kubernetes.volumes]
    [runners.kubernetes.dns_config]
gitlab-ci.yaml
job:
  script:
  - sleep 15

The job succeeds.

In the Runner log, we can see that the image is being pulled from docker.io registry

Using Kubernetes namespace: default                 job=2724486379 project=25452826 runner=DzfSJrxx
Using Kubernetes executor with image alpine:latest ...  job=2724486379 project=25452826 runner=DzfSJrxx
Using attach strategy to execute scripts...         job=2724486379 project=25452826 runner=DzfSJrxx
Using helper image: docker.io/gitlab/gitlab-runner-helper:x86_64-latest  job=2724486379 project=25452826 runner=DzfSJrxx

Contrarily to the proposal, the generated linked used to pull the image is formatted as follow: $default_docker_registry/gitlab-runner-helper.

What are the relevant issue numbers?

close gitlab#338586 (closed)

Edited by Romuald Atchadé

Merge request reports