MCPcopy Index your code
hub / github.com/coder/coder / CommandContext

Method CommandContext

agent/agentexec/exec.go:38–38  ·  view source on GitHub ↗

CommandContext returns an exec.Cmd that calls "coder agent-exec" prior to exec'ing the provided command if CODER_PROC_PRIO_MGMT is set, otherwise a normal exec.Cmd is returned. All instances of exec.Cmd should flow through this function to ensure proper resource constraints are applied to the child

(ctx context.Context, cmd string, args ...string)

Source from the content-addressed store, hash-verified

36 // is returned. All instances of exec.Cmd should flow through this function to ensure
37 // proper resource constraints are applied to the child process.
38 CommandContext(ctx context.Context, cmd string, args ...string) *exec.Cmd
39 // PTYCommandContext returns an pty.Cmd that calls "coder agent-exec" prior to exec'ing
40 // the provided command if CODER_PROC_PRIO_MGMT is set, otherwise a normal pty.Cmd
41 // is returned. All instances of pty.Cmd should flow through this function to ensure

Callers 15

TestAgentScriptFunction · 0.65
runLocalFunction · 0.65
openURLFunction · 0.65
headerTransportFunction · 0.65
dotfilesMethod · 0.65
ensureCorrectGitBranchFunction · 0.65
gitsshFunction · 0.65
TestSSH_ForwardGPGFunction · 0.65
TestProcGroupProcessExitFunction · 0.65
cmdMethod · 0.65

Implementers 6

recordedExeceragent/x/agentdesktop/portabledesktop_i
execeragent/agentexec/exec.go
priorityExeceragent/agentexec/exec.go
testDevcontainerExeceragent/agentcontainers/devcontainercli_
fakeExeceragent/agentcontainers/api_test.go
commandEnvExeceragent/agentcontainers/execer.go

Calls

no outgoing calls

Tested by 15

TestAgentScriptFunction · 0.52
TestSSH_ForwardGPGFunction · 0.52
TestProcGroupProcessExitFunction · 0.52
TestCreateTarFromZipFunction · 0.52
TestCreateZipFromTarFunction · 0.52
runSubprocessFunction · 0.52
CommandContextMethod · 0.52
binCmdFunction · 0.52
setCapsFunction · 0.52
TestExecerFunction · 0.52
runFunction · 0.52