Kubernetes/docker executor: add job timeout as annotations/labels
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
add the build timeout as pod annotation (kubernetes executor) and container label (docker executor)
Why was this MR needed?
this is primarily intended to signal external systems (such as pod-cleanup) when a build environment becomes potentially stale and can be removed should it for some reason still linger after its expected lifetime has been exceeded.
What's the best way to test this MR?
inspecting the build environment should reveal the newly added information
docker executor
docker inspect \
--format '{{ index .Config.Labels "com.gitlab.gitlab-runner.job.timeout"}}' \
$BUILD_CONTAINER_ID
kubernetes executor
kubectl get pod $BUILD_POD_ID -o jsonpath='{.metadata.annotations}'
What are the relevant issue numbers?
Edited by 🤖 GitLab Bot 🤖