Cannot create multiple links when creating and registering a docker runner
I am creating a docker runner using a command like:
docker run -d --name gitlab-runner-dind \
-v /var/run/docker.sock:/var/run/docker.sock \
-e "REGISTRATION_TOKEN=xyz" \
-e "CI_SERVER_URL=http://gitlab/ci" \
-e "RUNNER_NAME=docker" \
-e "RUNNER_EXECUTOR=docker" \
-e "DOCKER_LINKS=a:b, c:d" \
-e "DOCKER_IMAGE=gitlab/dind:latest" \
-e "DOCKER_PRIVILEGED=true" \
gitlab/gitlab-runner:latest
Next I register the runner in the following way:
docker exec -i -t gitlab-runner-dind gitlab-runner register -n
Which results in the config.toml in a runner like:
[[runners]]
name = "dind"
url = "http://gitlab/ci"
token = "xyz"
executor = "docker"
[runners.docker]
tls_verify = false
image = "gitlab/dind:latest"
links = ["a:b,c:d"]
The problem is that the links string should like ["a:b","c:d"], but the quotes are missing. I have tried many ways to add the quotes switching between weak and strong quotes, escaping and using the parameter insteat of the variable, but could not find a way to solve the issue.
The only way I got it working is when specify the parameter twice: gitlab-runner register -n --docker-links "a:b" --docker-links "c:d"
So do I mis understand the working or is it a bug?