Skip to content

Commit

Permalink
[JENKINS-46869] Can not register instance as an agent (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoblas authored and Francis Upton IV committed Sep 14, 2017
1 parent b267fa7 commit 447730b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/ec2/EC2Cloud.java
Expand Up @@ -553,7 +553,7 @@ public Collection<PlannedNode> provision(Label label, int excessWorkload) {
if (slave == null)
break;
LOGGER.log(Level.INFO, String.format("We have now %s computers", Jenkins.getInstance().getComputers().length));
if (!(t.isNode())) {
if (t.isNode()) {
Jenkins.getInstance().addNode(slave);
LOGGER.log(Level.INFO, String.format("Added node named: %s, We have now %s computers", slave.getNodeName(), Jenkins.getInstance().getComputers().length));
r.add(new PlannedNode(t.getDisplayName(), Computer.threadPoolForRemoting.submit(new Callable<Node>() {
Expand Down

2 comments on commit 447730b

@djanavar
Copy link

@djanavar djanavar commented on 447730b Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks agent registration for our Jenkins instance. I had to rollback to 1.36.
I am just looking at the changed lines, but I'm not sure why someone would want to addNode if t already isNode.
Also, there is no changelog added for the 1.37 release here: https://wiki.jenkins.io/display/JENKINS/Amazon+EC2+Plugin

@ryanaslett
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the isNode check was added in an earlier commit, as part of the pipeline support. It defaults to true, and only gets set to false as part of the pipeline stuff, so I think this is a red herring. Something else broke agent registration.

Please sign in to comment.