Skip to content

Commit

Permalink
Merge pull request #63 from mriddle/master
Browse files Browse the repository at this point in the history
[JENKINS-19301] Fix: spot instance feature cannot be used within VPC
  • Loading branch information
francisu committed Aug 23, 2013
2 parents 8d5be49 + 033b2a3 commit c33e297
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/hudson/plugins/ec2/SlaveTemplate.java
Expand Up @@ -471,12 +471,18 @@ private EC2AbstractSlave provisionSpot(TaskListener listener) throws AmazonClien

/* If we have a subnet ID then we can only use VPC security groups */
if (!securityGroupSet.isEmpty()) {
List<String> group_ids = getEc2SecurityGroups(ec2);
List<String> group_ids = getEc2SecurityGroups(ec2);
ArrayList<GroupIdentifier> groups = new ArrayList<GroupIdentifier>();

if (!group_ids.isEmpty()) {
launchSpecification.setSecurityGroups(group_ids);
}
}
for (String group_id : group_ids) {
GroupIdentifier group = new GroupIdentifier();
group.setGroupId(group_id);
groups.add(group);
}

if (!groups.isEmpty())
launchSpecification.setAllSecurityGroups(groups);
}
} else {
/* No subnet: we can use standard security groups by name */
if (securityGroupSet.size() > 0)
Expand Down

0 comments on commit c33e297

Please sign in to comment.