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

Commit7358ee0

Browse files
committed
feat(agent/agentcontainers): implement sub agent injection
This change adds support for sub agent creation and injection into devcontainers.Closescoder/internal#621
1 parent709f374 commit7358ee0

File tree

5 files changed

+698
-35
lines changed

5 files changed

+698
-35
lines changed

‎agent/agent.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
11881188
// createOrUpdateNetwork waits for the manifest to be set using manifestOK, then creates or updates
11891189
// the tailnet using the information in the manifest
11901190
func (a*agent)createOrUpdateNetwork(manifestOK,networkOK*checkpoint)func(context.Context, proto.DRPCAgentClient26)error {
1191-
returnfunc(ctx context.Context,_ proto.DRPCAgentClient26) (retErrerror) {
1191+
returnfunc(ctx context.Context,aAPI proto.DRPCAgentClient26) (retErrerror) {
11921192
iferr:=manifestOK.wait(ctx);err!=nil {
11931193
returnxerrors.Errorf("no manifest: %w",err)
11941194
}
@@ -1208,6 +1208,7 @@ func (a *agent) createOrUpdateNetwork(manifestOK, networkOK *checkpoint) func(co
12081208
// agent API.
12091209
network,err=a.createTailnet(
12101210
a.gracefulCtx,
1211+
aAPI,
12111212
manifest.AgentID,
12121213
manifest.DERPMap,
12131214
manifest.DERPForceWebSockets,
@@ -1355,6 +1356,7 @@ func (a *agent) trackGoroutine(fn func()) error {
13551356

13561357
func (a*agent)createTailnet(
13571358
ctx context.Context,
1359+
aAPI proto.DRPCAgentClient26,
13581360
agentID uuid.UUID,
13591361
derpMap*tailcfg.DERPMap,
13601362
derpForceWebSockets,disableDirectConnectionsbool,
@@ -1487,7 +1489,7 @@ func (a *agent) createTailnet(
14871489
}()
14881490
iferr=a.trackGoroutine(func() {
14891491
deferapiListener.Close()
1490-
apiHandler,closeAPIHAndler:=a.apiHandler()
1492+
apiHandler,closeAPIHAndler:=a.apiHandler(aAPI)
14911493
deferfunc() {
14921494
_=closeAPIHAndler()
14931495
}()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp