Duplicate task slugs when creating more than one WorkerVersion build task
With a repo YAML config that states there are multiple workers that use different Dockerfiles:
---
version: 2
type: worker
workers:
- slug: worker1
name: blah1
type: lol
docker:
build: Dockerfile1
- slug: worker2
name: blah2
type: lol
docker:
build: Dockerfile2
The import_git.worker
task will attempt to create two build tasks, both named docker_build_worker2
. This causes the second task, for Dockerfile2
, to not be created and instead have a HTTP 500 (ponos#111).
This line is the only place where a worker is assigned, in a first for loop; one the loop is completed, the last worker remains in this variable, and in the next loop to create one task per Dockerfile, only the last worker's slug will be used.
Since multiple workers could share the same Dockerfile, naming the build task after the worker's slug does not make much sense and it might be better to name the tasks after the Dockerfile names themselves.
Edited by Erwan Rouchet