Skip to content
Permalink
Browse files

JENKINS-32584 ec2-plugin counts *every* instance (not just Jenkins sl…

…ave instances) when counting slaves; incorrectly hits slave cap
  • Loading branch information...
Francis Upton IV
Francis Upton IV committed Jan 25, 2016
1 parent 97a840e commit f95e3d52c3872f0fddb1d97f23253b5593eeb641
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/hudson/plugins/ec2/EC2Cloud.java
@@ -279,8 +279,8 @@ private int countCurrentEC2Slaves(SlaveTemplate template) throws AmazonClientExc

for (Reservation r : connect().describeInstances().getReservations()) {
for (Instance i : r.getInstances()) {
if ((template == null
|| template.getAmi().equals(i.getImageId()) && isEc2ProvisionedAmiSlave(i.getTags(), description))) {
if (isEc2ProvisionedAmiSlave(i.getTags(), description) && (template == null
|| template.getAmi().equals(i.getImageId()))) {
InstanceStateName stateName = InstanceStateName.fromValue(i.getState().getName());
if (stateName != InstanceStateName.Terminated && stateName != InstanceStateName.ShuttingDown) {
LOGGER.log(Level.FINE, "Existing instance found: " + i.getInstanceId() + " AMI: " + i.getImageId()

0 comments on commit f95e3d5

Please sign in to comment.
You can’t perform that action at this time.