-
Notifications
You must be signed in to change notification settings - Fork 324
Description
- docker-plugin version : 1.2.1
- jenkins version : 2.249.2
- docker engine version : 19.03.13
In com.nirima.jenkins.plugins.docker.DockerCloud
in canAddProvisionedSlave()
, an estimation of running template agents is done.
This is done by counting the running containers using the same image as the template image, which is wrong since multiple templates of the same cloud can use the same Docker image.
In my case, I have 2 templates (A and B) with the same Docker image, but different container capacities (2 and 5) and different agent labels (for limiting the builds). When the running containers count equals the container capacity of template A (cap=2), canAddProvisionedSlave()
also returns false
for template B (cap=5), even though it has no running agents and should have enough capacity to provision up to 5 agents.
It may be fixed by adding a template label to each container and add a filter on this label to count running template agents?