Ulimit deemed required by config validation
Summary
16.2 gitlab-runner added ulimit parameter for docker executor. When registering a runner with non-interactive one-line command, the ulimit field is not populated (and I think that's perfectly fine). After this, if you run gitlab-runner list, you get a validation warning about wrongly formatted (missing) ulimit.
Steps to reproduce
Register a runner with
sudo REGISTER_NON_INTERACTIVE=true gitlab-runner register --url https://gitlab.com --token "redacted" --executor "docker" --docker-image "alpine:3" --docker-privileged --docker-tlsverify --docker-volumes "/certs/client" --docker-volumes "/cache"
and then run
sudo gitlab-runner list
and you will get a validation warning:
Runtime platform arch=amd64 os=linux pid=3731 revision=674e0e29 version=16.2.1
There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
jsonschema: '/runners/0/docker/ulimit' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/docker/$ref/properties/ulimit/type: expected object, but got null
Actual behavior
Warns about incorrectly formatted ulimit
Expected behavior
Should have ulimit as optional in schema and validate without warning when ulimit is omitted.
Environment description
Running our own runner on an EC2 instance with gitlab-runner 16.2.1.
config.toml contents
listen_address = "0.0.0.0:9252"
concurrent = 6
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "ip-10-0-redacted.eu-central-1.compute.internal"
url = "https://gitlab.com"
id = 258redacted
token = "glrt-redacted"
token_obtained_at = 2023-08-15T05:37:18Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.docker]
tls_verify = true
image = "alpine:3"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/certs/client", "/cache"]
shm_size = 0
Used GitLab Runner version
gitlab-runner --version Version: 16.2.1 Git revision: 674e0e29 Git branch: 16-2-stable GO version: go1.20.5 Built: 2023-08-08T00:08:26+0000 OS/Arch: linux/amd64
Possible fixes
Adjust the schema to make ulimit optional.