Skip to content

Commit

Permalink
[core][executor] Support pushing the control port via env var
Browse files Browse the repository at this point in the history
OCTRL-81 #close
  • Loading branch information
teo committed Dec 13, 2018
1 parent b5be0eb commit 581fb86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,10 @@ func resourceOffers(state *internalState, fidStore store.Singleton) events.Handl
remainingResources.Subtract(builder.Resource)

// Append control port to arguments
// For the control port parameter and/or environment variable, see occ/OccGlobals.h
cmd.Arguments = append(cmd.Arguments, "--control-port", strconv.FormatUint(controlPort, 10))
cmd.ControlPort = controlPort
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%d", "OCC_CONTROL_PORT", controlPort))

runCommand := *cmd

Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func launch(state *internalState, task mesos.TaskInfo) {
} else {
taskCmd = exec.Command(*commandInfo.Value, commandInfo.Arguments...)
}
taskCmd.Env = append(os.Environ())
taskCmd.Env = append(os.Environ(), commandInfo.Env...)

var errStdout, errStderr error
stdoutIn, _ := taskCmd.StdoutPipe()
Expand Down

0 comments on commit 581fb86

Please sign in to comment.