Skip to content

Commit

Permalink
Merge pull request #490 from jglick/bourneShellElsewhereInPath
Browse files Browse the repository at this point in the history
Verifying that tools do not assume sh is in /bin/sh
  • Loading branch information
Vlatombe authored Jul 6, 2019
2 parents 08c2f47 + 88e7f02 commit ad124ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class ContainerExecDecorator extends LauncherDecorator implements Seriali
private static final String COOKIE_VAR = "JENKINS_SERVER_COOKIE";

private static final Logger LOGGER = Logger.getLogger(ContainerExecDecorator.class.getName());
private static final String DEFAULT_SHELL="/bin/sh";
private static final String DEFAULT_SHELL = "sh";

/**
* stdin buffer size for commands sent to Kubernetes exec api. A low value will cause slowness in commands executed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ public void runInPodWithDifferentShell() throws Exception {
*/
}

@Test
public void bourneShellElsewhereInPath() throws Exception {
r.assertBuildStatusSuccess(r.waitForCompletion(b));
r.assertLogContains("/kaniko:/busybox", b);
}

@Test
public void runInPodWithMultipleContainers() throws Exception {
r.assertBuildStatusSuccess(r.waitForCompletion(b));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
podTemplate(label: '$NAME', containers: [containerTemplate(name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: 'sleep', args: '99d')]) {
node('$NAME') {
container(name: 'kaniko') {
sh 'echo $PATH'
}
}
}

0 comments on commit ad124ef

Please sign in to comment.