Skip to content

Expand variables for Pod volume subPath + mountpath config

What does this MR do?

Simply expands variables in user-provided subPath + mountPath values for runner config.

Inspiration from @jansmets' comment here: #3847 (comment 269924207)

The intention is to configure the runner like this:

[[runners]]
  [runners.kubernetes]
    [runners.kubernetes.volumes]
      [[runners.kubernetes.volumes.pvc]]
        name = "gitlab-builds"
        mount_path = '/builds/$CI_CONCURRENT_PROJECT_ID/$CI_PROJECT_PATH'
        sub_path = 'builds/$CI_CONCURRENT_PROJECT_ID/$CI_PROJECT_PATH'

Why was this MR needed?

For our organisation we need a simple way to make a shared build_dir PVC secure, easiest way is to leverage PVC subPath + mountPath option to make the clone dir isolated for each job.

What's the best way to test this MR?

What are the relevant issue numbers?

#28158 (closed)
#3847 (closed)

Edited by Dom Honey

Merge request reports