Kubernetes/docker executor: add job timeout as annotations/labels

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 🤖

Merge request reports

Loading