Configuration file template does not merge runners.docker.volumes
Summary
When attempting to use the new configuration template file feature, the contents of the docker volumes field are not actually merged.
Steps to reproduce
root@6f67674d3a63:/etc/gitlab-runner# ls
certs docker-compose.yml template-config.toml
root@6f67674d3a63:/etc/gitlab-runner# cat template-config.toml
[[runners]]
[runners.docker]
volumes = [
# Default, needed to persist cache between runs
"/cache",
# Needed for docker:dind and docker-compose
"/var/run/docker.sock:/var/run/docker.sock",
# Enable docker-compose to access the build dir
"/builds:/builds"
]
root@6f67674d3a63:/etc/gitlab-runner# gitlab-runner register --template-config=template-config.toml
Runtime platform arch=amd64 os=linux pid=1360 revision=a987417a version=12.2.0
Running in system-mode.
Registering runner... succeeded runner=tfKDMJSn
Merging configuration from template file "template-config.toml"
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
Actual behavior
root@6f67674d3a63:/etc/gitlab-runner# cat config.toml
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "6f67674d3a63"
limit = 1
url = "https://our-private-gitlab"
token = "xxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "docker:19.03.2-dind"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Expected behavior
root@6f67674d3a63:/etc/gitlab-runner# cat config.toml
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "6f67674d3a63"
limit = 1
url = "https://our-private-gitlab"
token = "xxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "docker:19.03.2-dind"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = [
# Default, needed to persist cache between runs
"/cache",
# Needed for docker:dind and docker-compose
"/var/run/docker.sock:/var/run/docker.sock",
# Enable docker-compose to access the build dir
"/builds:/builds"
]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Environment description
I am using the gitlab/gitlab-runner:v12.2.0
container image, running on CoreOS using Server Version: 18.06.3-ce
.
Used GitLab Runner version
Version: 12.2.0
Git revision: a987417a
Git branch: 12-2-stable
GO version: go1.8.7
Built: 2019-08-22T13:06:00+0000
OS/Arch: linux/amd64
Possible fixes
Edited by Darren Eastman