Skip to content

Add support for custom labels for docker containers spawned by docker executor

What does this MR do?

Adds the config container_labels to runners.docker.

[[runners]]
  [runners.docker]
    executor = "docker"
    [runners.docker.container_labels]
      "com.test.customlabel" = "custom-$VAR_1"

Closes #4580 (closed)

Why was this MR needed?

See #4580 (closed) for context.

Are there points in the code the reviewer needs to double check?

  • Documentation: Should the new option be documented in executors/docker.md? I could not find a good place for it.
  • Tests: Is there a better way than expanding prepareTestDockerConfiguration with an environment variable solely for the label test?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

#4580 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports