Skip to content

Commit

Permalink
Merge pull request #315 from jenkinsci/JENKINS-50913
Browse files Browse the repository at this point in the history
[JENKINS-50913] Do not pass arguments to jnlp container
  • Loading branch information
carlossg committed Apr 24, 2018
2 parents cf7e719 + 170b51e commit 6d4508d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.kohsuke.accmod.restrictions.NoExternalUse;

import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import edu.umd.cs.findbugs.annotations.CheckForNull;
Expand Down Expand Up @@ -234,9 +233,6 @@ public Pod build() {
if (StringUtils.isBlank(jnlp.getImage())) {
jnlp.setImage(DEFAULT_JNLP_IMAGE);
}
if (jnlp.getArgs().isEmpty() && slave != null) {
jnlp.setArgs(ImmutableList.of(slave.getComputer().getJnlpMac(), slave.getComputer().getName()));
}
Map<String, EnvVar> envVars = defaultEnvVars(slave,
jnlp.getWorkingDir() != null ? jnlp.getWorkingDir() : ContainerTemplate.DEFAULT_WORKING_DIR,
template.getEnvVars());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void validateJnlpContainer(Container jnlp, KubernetesSlave slave) {
new EnvVar("HOME", "/home/jenkins", null) //
);
if (slave != null) {
assertThat(jnlp.getArgs(), contains(AGENT_SECRET, AGENT_NAME));
assertThat(jnlp.getArgs(), empty());
envVars.add(new EnvVar("JENKINS_URL", JENKINS_URL, null));
envVars.add(new EnvVar("JENKINS_SECRET", AGENT_SECRET, null));
envVars.add(new EnvVar("JENKINS_NAME", AGENT_NAME, null));
Expand Down

0 comments on commit 6d4508d

Please sign in to comment.