Loading
Reset log level and format to default values when not set
What does this MR do?
When the config.toml is manually edited, a configuration reload occurs within GitLab Runner. As it stands, when the log level is removed from the config.toml, the log level keeps the previous value. This MR reset the log level to its default value when the configuration is entirely removed.
The same is done with the log format
Why was this MR needed?
To reset the log level to info when the log_level is removed from the config.toml. Reset the log format to text when log_format is removed from the config.toml
What's the best way to test this MR?
go test -timeout 300s -run ^TestRunCommand_configReloading$ gitlab.com/gitlab-org/gitlab-runner/commands
=== RUN TestRunCommand_configReloading
time="2024-07-27T16:53:14-04:00" level=info msg="Created missing unique system ID" system_id=s_b188029b2abb
time="2024-07-27T16:53:14-04:00" level=info msg="Configuration loaded" builds=0 max_builds=1
time="2024-07-27T16:53:14-04:00" level=debug msg="listenaddress: \"\"\nsessionserver:\n listenaddress: \"\"\n advertiseaddress: \"\"\n sessiontimeout: 1800\nconcurrent: 1\ncheckinterval: 1\nloglevel: debug\nlogformat: null\nuser: \"\"\nrunners: []\nsentrydsn: null\nconnectionmaxage: 15m0s\nmodtime: 2024-07-27T16:53:14.410275205-04:00\nloaded: true\nshutdowntimeout: 0\n" builds=0 max_builds=1
time="2024-07-27T16:53:14-04:00" level=info msg="Configuration loaded" builds=0 max_builds=1
time="2024-07-27T16:53:14-04:00" level=debug msg="listenaddress: \"\"\nsessionserver:\n listenaddress: \"\"\n advertiseaddress: \"\"\n sessiontimeout: 1800\nconcurrent: 1\ncheckinterval: 1\nloglevel: debug\nlogformat: null\nuser: \"\"\nrunners: []\nsentrydsn: null\nconnectionmaxage: 15m0s\nmodtime: 2024-07-27T16:53:14.410275205-04:00\nloaded: true\nshutdowntimeout: 0\n" builds=0 max_builds=1
time="2024-07-27T16:53:14-04:00" level=info msg="Configuration loaded" builds=0 max_builds=1
--- PASS: TestRunCommand_configReloading (0.10s)
PASS
ok gitlab.com/gitlab-org/gitlab-runner/commands 0.845s
What are the relevant issue numbers?
close #37490 (closed)
Edited by Romuald Atchadé