externalAgentReadyError returns the external-agent-specific error message when agent belongs to an external resource, or the empty string otherwise. Errors looking up the resource are treated as non-external so the caller falls back to the dial error.
( ctx context.Context, db database.Store, agent database.WorkspaceAgent, )
| 602 | // string otherwise. Errors looking up the resource are treated as |
| 603 | // non-external so the caller falls back to the dial error. |
| 604 | func externalAgentReadyError( |
| 605 | ctx context.Context, |
| 606 | db database.Store, |
| 607 | agent database.WorkspaceAgent, |
| 608 | ) string { |
| 609 | isExternal, err := IsExternalWorkspaceAgent(ctx, db, agent) |
| 610 | if err != nil || !isExternal { |
| 611 | return "" |
| 612 | } |
| 613 | return ExternalAgentUnavailableMessage(agent) |
| 614 | } |
| 615 | |
| 616 | // waitForAgentReady waits for the workspace agent to become |
| 617 | // reachable and for its startup scripts to finish. It returns |
no test coverage detected