Skip to content

Commit

Permalink
JENKINS-20743
Browse files Browse the repository at this point in the history
GuestInfo functionality can now see the slave secret as a variable
JNLP_SECRET so this can now be passed to the slave.
  • Loading branch information
pjdarton committed Sep 19, 2016
1 parent 8971edf commit 1af1b4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -37,6 +37,7 @@
import java.util.logging.Logger;

import jenkins.model.Jenkins;
import jenkins.slaves.JnlpSlaveAgentProtocol;

import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
Expand Down Expand Up @@ -355,6 +356,10 @@ private EnvVars calculateVariablesForGuestInfo(final String cloneName, final Tas
addEnvVar(knownVariables, "JENKINS_URL", jenkinsUrl);
addEnvVar(knownVariables, "HUDSON_URL", jenkinsUrl);
}
final String slaveSecret = JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(cloneName);
if (slaveSecret != null) {
addEnvVar(knownVariables, "JNLP_SECRET", slaveSecret);
}
addEnvVars(knownVariables, listener, Jenkins.getInstance().getGlobalNodeProperties());
addEnvVars(knownVariables, listener, this.nodeProperties);
addEnvVar(knownVariables, "NODE_NAME", cloneName);
Expand Down
Expand Up @@ -19,6 +19,7 @@
<tt>NODE_NAME</tt>,
<tt>NODE_LABELS</tt>.
</li>
<li>The value to be passed with the <tt>-secret</tt> argument if the slave is connecting via JNLP: <tt>JNLP_SECRET</tt>.</li>
<li>The following properties from this vSphere template definition:
<tt>cluster</tt>,
<tt>datastore</tt>,
Expand All @@ -27,7 +28,7 @@
<tt>remoteFS</tt>,
<tt>snapshotName</tt>,
<tt>targetHost</tt>,
<tt>templateDescription</tt>
<tt>templateDescription</tt>.
</li>
</ul>
</p>
Expand Down

0 comments on commit 1af1b4a

Please sign in to comment.