Skip to content

Commit

Permalink
rename to task-pid and runAsTaskUser
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Nov 18, 2015
1 parent 1adc79f commit 255a899
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Expand Up @@ -248,7 +248,7 @@ public class SingularityExecutorConfiguration extends BaseRunnerConfiguration {
private String shellCommandUserPlaceholder = "{USER}";

@JsonProperty
private String shellCommandPidFile = ".shell_command_pid";
private String shellCommandPidFile = ".task-pid";

public SingularityExecutorConfiguration() {
super(Optional.of("singularity-executor.log"));
Expand Down
Expand Up @@ -26,7 +26,7 @@ public class SingularityExecutorShellCommandDescriptor {

@JsonProperty
@NotNull
private boolean switchUser = true;
private boolean runAsTaskUser = true;

public List<SingularityExecutorShellCommandOptionDescriptor> getOptions() {
return options;
Expand All @@ -52,11 +52,11 @@ public List<String> getCommand() {
return command;
}

public boolean isSwitchUser() {
return switchUser;
public boolean isRunAsTaskUser() {
return runAsTaskUser;
}

public void setSwitchUser(boolean switchUser) {
this.switchUser = switchUser;
public void setRunAsTaskUser(boolean runAsTaskUser) {
this.runAsTaskUser = runAsTaskUser;
}
}
Expand Up @@ -22,7 +22,6 @@
import com.hubspot.singularity.executor.config.SingularityExecutorConfiguration;
import com.hubspot.singularity.executor.task.SingularityExecutorTask;
import com.hubspot.singularity.executor.task.SingularityExecutorTaskProcessCallable;
import com.spotify.docker.client.DockerClient;

public class SingularityExecutorShellCommandRunner {

Expand Down Expand Up @@ -126,7 +125,7 @@ public boolean apply(SingularityExecutorShellCommandDescriptor input) {

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

if (shellCommandDescriptor.isSwitchUser()) {
if (shellCommandDescriptor.isRunAsTaskUser()) {
String switchUserCommand = String.format(executorConfiguration.getSwitchUserCommandFormat(), taskProcess.getTask().getExecutorData().getUser().or(executorConfiguration.getDefaultRunAsUser()));
command.addAll(Arrays.asList(switchUserCommand.split("\\s+")));
}
Expand Down

0 comments on commit 255a899

Please sign in to comment.