Skip to content
Permalink
Browse files

Merge pull request #63 from mriddle/master

[JENKINS-19301] Fix: spot instance feature cannot be used within VPC
  • Loading branch information
francisu committed Aug 23, 2013
2 parents 8d5be49 + 033b2a3 commit c33e297f2c3c748daffd97ca50f078caa74d3d62
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/main/java/hudson/plugins/ec2/SlaveTemplate.java
@@ -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)

0 comments on commit c33e297

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