Skip to content

Commit

Permalink
Skip shell command prefix for docker only, if configured.
Browse files Browse the repository at this point in the history
  • Loading branch information
baconmania committed Mar 25, 2019
1 parent 75d710d commit 7cd6458
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,15 @@ public boolean apply(SingularityExecutorShellCommandDescriptor input) {

List<String> command = new ArrayList<>();

if (!shellCommandDescriptor.isSkipCommandPrefix()) {
command.addAll(executorConfiguration.getShellCommandPrefix());
}

boolean isDocker = task.getTaskInfo().hasContainer() && task.getTaskInfo().getContainer().hasDocker();
if (isDocker) {
if (!shellCommandDescriptor.isSkipCommandPrefix() && !shellCommandDescriptor.isSkipCommandPrefixDockerOnly()) {
command.addAll(executorConfiguration.getShellCommandPrefix());
}

command.addAll(Arrays.asList("docker", "exec", String.format("%s%s", executorConfiguration.getDockerPrefix(), task.getTaskId())));
} else if (!shellCommandDescriptor.isSkipCommandPrefix()) {
command.addAll(executorConfiguration.getShellCommandPrefix());
}

command.addAll(shellCommandDescriptor.getCommand());
Expand Down

0 comments on commit 7cd6458

Please sign in to comment.