mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add agent log streaming and follow provisioner format (#8170)
This commit is contained in:
+2
-9
@@ -176,23 +176,16 @@ func (r *RootCmd) ssh() *clibase.Cmd {
|
||||
// OpenSSH passes stderr directly to the calling TTY.
|
||||
// This is required in "stdio" mode so a connecting indicator can be displayed.
|
||||
err = cliui.Agent(ctx, inv.Stderr, cliui.AgentOptions{
|
||||
WorkspaceName: workspace.Name,
|
||||
Fetch: func(ctx context.Context) (codersdk.WorkspaceAgent, error) {
|
||||
return client.WorkspaceAgent(ctx, workspaceAgent.ID)
|
||||
},
|
||||
Wait: wait,
|
||||
FetchLogs: client.WorkspaceAgentStartupLogsAfter,
|
||||
Wait: wait,
|
||||
})
|
||||
if err != nil {
|
||||
if xerrors.Is(err, context.Canceled) {
|
||||
return cliui.Canceled
|
||||
}
|
||||
if !xerrors.Is(err, cliui.AgentStartError) {
|
||||
return xerrors.Errorf("await agent: %w", err)
|
||||
}
|
||||
|
||||
// We don't want to fail on a startup script error because it's
|
||||
// natural that the user will want to fix the script and try again.
|
||||
// We don't print the error because cliui.Agent does that for us.
|
||||
}
|
||||
|
||||
if r.disableDirect {
|
||||
|
||||
Reference in New Issue
Block a user