chore(agent/agentssh): extract CreateCommandDeps (#16603)

Extracts environment-level dependencies of
`agentssh.Server.CreateCommand()` to an interface to allow alternative
implementations to be passed in.
This commit is contained in:
Cian Johnston
2025-02-19 09:03:59 +00:00
committed by GitHub
parent 52cc0ce523
commit 4edd77bc82
5 changed files with 91 additions and 11 deletions

View File

@ -283,7 +283,7 @@ func (r *Runner) run(ctx context.Context, script codersdk.WorkspaceAgentScript,
cmdCtx, ctxCancel = context.WithTimeout(ctx, script.Timeout)
defer ctxCancel()
}
cmdPty, err := r.SSHServer.CreateCommand(cmdCtx, script.Script, nil)
cmdPty, err := r.SSHServer.CreateCommand(cmdCtx, script.Script, nil, nil)
if err != nil {
return xerrors.Errorf("%s script: create command: %w", logPath, err)
}