Skip to content

Commit

Permalink
Merge pull request #1475 from Vlatombe/JENKINS-70217
Browse files Browse the repository at this point in the history
[JENKINS-70217] Default ContainerTemplate command and arg to empty string when using casc.
  • Loading branch information
Vlatombe authored Nov 24, 2023
2 parents ad406fb + 30a6feb commit 7b3f77f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public class ContainerTemplate extends AbstractDescribableImpl<ContainerTemplate

private String workingDir;

private String command;
private String command = "";

private String args;
private String args = "";

private boolean ttyEnabled;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected void assertConfiguredAsExpected(RestartableJenkinsRule r, String confi
assertThat(podTemplate.getYamlMergeStrategy(), isA(Merge.class));
List<ContainerTemplate> containers = podTemplate.getContainers();
assertNotNull(containers);
assertEquals(1, containers.size());
assertEquals(2, containers.size());
ContainerTemplate container = containers.get(0);
assertEquals("cat", container.getArgs());
assertEquals("/bin/sh -c", container.getCommand());
Expand All @@ -78,6 +78,9 @@ protected void assertConfiguredAsExpected(RestartableJenkinsRule r, String confi
assertEquals("maven",container.getName());
assertTrue(container.isTtyEnabled());
assertEquals("/src", container.getWorkingDir());
var containerTemplate = containers.get(1);
assertEquals("", containerTemplate.getCommand());
assertEquals("", containerTemplate.getArgs());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jenkins:
name: "maven"
ttyEnabled: true
workingDir: "/src"
- name: "maven-with-default-entrypoint"
image: "maven:3.6.3-jdk-8"
hostNetwork: false
label: "test"
name: "test"
Expand Down

0 comments on commit 7b3f77f

Please sign in to comment.