Skip to content

Merge the config template before asking the user for configuration

What does this MR do?

Merge the config template before asking the user for configuration

Why was this MR needed?

Not all configuration parameters are taken from the config template. See this example:

$ cat >config.template.toml <<EOL
[[runners]]
  name = "test-runner"
  url = "https://gitlab.com/"
  executor = "docker"
  [runners.docker]
    image = "ubuntu:18.04"
EOL
$ gitlab-runner-darwin-amd64 --log-level debug register --template-config config.template.toml --non-interactive
Runtime platform                                    arch=amd64 os=darwin pid=18524 revision=ece86343 version=13.5.0
Checking runtime mode                               GOOS=darwin uid=501
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...

PANIC: The url needs to be entered

What's the best way to test this MR?

Use the above test commands. With this, the only required configuration parameter is REGISTRATION_TOKEN/--registration-token. This is because this configuration option isn't available in the config (template).

What are the relevant issue numbers?

gitlab-org/charts/gitlab-runner#87 (closed)

Closes gitlab-org/charts/gitlab-runner#334 (closed)

Edited by Arran Walker

Merge request reports