I’m testing the new method for registering runners in a test setup. It mostly works, on the runner server:
root@gitlab:~# curl -k -H 'Private-token: <pat-for root>' -X POST 'http://10.0.3.103/api/v4/user/runners?runner_type=instance_type&description=Test_i_kitchen&paused=True&tag_list=test' | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 68 100 68 0 0 140 0 --:--:-- --:--:-- --:--:-- 140
{
"id": 2,
"token": "glrt-Ht29KNg59pMNDrRzrdcf",
"token_expires_at": null
}
root@gitlab:~# gitlab-runner register --non-interactive --url http://10.0.3.103 --token glrt-Ht29KNg59pMNDrRzrdcf --executor shell
Runtime platform arch=amd64 os=linux pid=10895 revision=436955cb version=15.11.0
Running in system-mode.
Verifying runner... is valid runner=Ht29KNg59
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
but if I then look in /etc/gitlab-runner/config.toml
I see:
[[runners]]
name = "gitlab"
url = "http://10.0.3.103"
id = 2
token = "glrt-Ht29KNg59pMNDrRzrdcf"
token_obtained_at = 2023-06-07T14:51:44Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "shell"
[runners.cache]
MaxUploadedArchiveSize = 0
(and some global settings and configuration of some runners registered against an old test setup, that I want to replace with this)
And I can see that the name
for this new runner is gitlab
instead of Test_i_kitchen
(that’s danish, but I guess anybody can figure out what it says, even though that’s not important) that I (thought I) specified. Why?
The new runner(s) also don’t seem to be registered on the GitLab server:
root@gitlab:~# curl -k -H 'Private-token: <pat-for-root>' --header 'Content-Type: application/json' --header 'Accept: application/json' -X GET 'http://10.0.3.103/api/v4/runners'
returns an empty array.