Allow token to be passed by environment variable
The runner token must be specified in the
config.toml file. I'd like to store the token in as a Kubernetes secret, and not in the ConfigMap.
The only way to do this now is to override the Dockerfile entrypoint with a script that takes the token as an environment variable (injected from the k8s secret), and patch the mounted configuration file before
exec'ing to the original entrypoint. This workaround is undesirable.
After parsing the
config.toml file, if the secret looks like
ENV['env-name'], then look up the environment variable
env-name for the secret. (This is for consistency with the main GitLab ruby configuration file; but any syntax for an environment variable lookup is welcomed.)