feat(coderd/agentapi): implement sub agent api (#17823)

Closes https://github.com/coder/internal/issues/619

Implement the `coderd` side of the AgentAPI for the upcoming
dev-container agents work.

`agent/agenttest/client.go` is left unimplemented for a future PR
working to implement the agent side of this feature.
This commit is contained in:
Danielle Maywood
2025-05-29 12:15:47 +01:00
committed by GitHub
parent bc83de2a72
commit b712d0b23f
25 changed files with 1767 additions and 252 deletions

View File

@ -95,8 +95,8 @@ type Options struct {
}
type Client interface {
ConnectRPC25(ctx context.Context) (
proto.DRPCAgentClient25, tailnetproto.DRPCTailnetClient25, error,
ConnectRPC26(ctx context.Context) (
proto.DRPCAgentClient26, tailnetproto.DRPCTailnetClient26, error,
)
RewriteDERPMap(derpMap *tailcfg.DERPMap)
}
@ -908,7 +908,7 @@ func (a *agent) run() (retErr error) {
a.sessionToken.Store(&sessionToken)
// ConnectRPC returns the dRPC connection we use for the Agent and Tailnet v2+ APIs
aAPI, tAPI, err := a.client.ConnectRPC25(a.hardCtx)
aAPI, tAPI, err := a.client.ConnectRPC26(a.hardCtx)
if err != nil {
return err
}