Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb712d0b

Browse files
feat(coderd/agentapi): implement sub agent api (#17823)
Closescoder/internal#619Implement the `coderd` side of the AgentAPI for the upcomingdev-container agents work.`agent/agenttest/client.go` is left unimplemented for a future PRworking to implement the agent side of this feature.
1 parentbc83de2 commitb712d0b

File tree

25 files changed

+1745
-230
lines changed

25 files changed

+1745
-230
lines changed

‎agent/agent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ type Options struct {
9595
}
9696

9797
typeClientinterface {
98-
ConnectRPC25(ctx context.Context) (
99-
proto.DRPCAgentClient25, tailnetproto.DRPCTailnetClient25,error,
98+
ConnectRPC26(ctx context.Context) (
99+
proto.DRPCAgentClient26, tailnetproto.DRPCTailnetClient26,error,
100100
)
101101
RewriteDERPMap(derpMap*tailcfg.DERPMap)
102102
}
@@ -908,7 +908,7 @@ func (a *agent) run() (retErr error) {
908908
a.sessionToken.Store(&sessionToken)
909909

910910
// ConnectRPC returns the dRPC connection we use for the Agent and Tailnet v2+ APIs
911-
aAPI,tAPI,err:=a.client.ConnectRPC25(a.hardCtx)
911+
aAPI,tAPI,err:=a.client.ConnectRPC26(a.hardCtx)
912912
iferr!=nil {
913913
returnerr
914914
}

‎agent/agenttest/client.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ func (c *Client) Close() {
9898
c.derpMapOnce.Do(func() {close(c.derpMapUpdates) })
9999
}
100100

101-
func (c*Client)ConnectRPC25(ctx context.Context) (
102-
agentproto.DRPCAgentClient25, proto.DRPCTailnetClient25,error,
101+
func (c*Client)ConnectRPC26(ctx context.Context) (
102+
agentproto.DRPCAgentClient26, proto.DRPCTailnetClient26,error,
103103
) {
104104
conn,lis:=drpcsdk.MemTransportPipe()
105105
c.LastWorkspaceAgent=func() {
@@ -365,6 +365,18 @@ func (f *FakeAgentAPI) GetConnectionReports() []*agentproto.ReportConnectionRequ
365365
returnslices.Clone(f.connectionReports)
366366
}
367367

368+
func (*FakeAgentAPI)CreateSubAgent(_ context.Context,_*agentproto.CreateSubAgentRequest) (*agentproto.CreateSubAgentResponse,error) {
369+
panic("unimplemented")
370+
}
371+
372+
func (*FakeAgentAPI)DeleteSubAgent(_ context.Context,_*agentproto.DeleteSubAgentRequest) (*agentproto.DeleteSubAgentResponse,error) {
373+
panic("unimplemented")
374+
}
375+
376+
func (*FakeAgentAPI)ListSubAgents(_ context.Context,_*agentproto.ListSubAgentsRequest) (*agentproto.ListSubAgentsResponse,error) {
377+
panic("unimplemented")
378+
}
379+
368380
funcNewFakeAgentAPI(t testing.TB,logger slog.Logger,manifest*agentproto.Manifest,statsChchan*agentproto.Stats)*FakeAgentAPI {
369381
return&FakeAgentAPI{
370382
t:t,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp