Fix json schema validation warnings

What does this MR do?

Fix json schema validation warnings

For some configs we missed the proper json annotations, which resulted in validation errors messages like

There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
jsonschema: '/runners/0/custom_build_dir/enabled' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/custom_build_dir/$ref/properties/enabled/type: expected boolean, but got null

This backfills the missing annotations and adds some tests to catch similar issues in the future.

Note: Validation is best effort and does not block the runner to do it's job, it's solely informational.

Why was this MR needed?

To not print warnings for valid configurations.

What's the best way to test this MR?

Run

go run main.go register --non-interactive -u https://gitlab.com/ -t $GL_RUNNER_TOKEN -c /tmp/foo.toml  --executor docker --custom_build_dir-enabled=true --docker-ulimit=foo:bar --docker-ulimit=blipp:blupp --docker-services_devices=bnarz:blerp --docker-image=alpine

and see that are not messages re. validation issues are logged.

What are the relevant issue numbers?

/cc @DarrenEastman @sauravissar

Edited by Hannes Hörl

Merge request reports

Loading