@@ -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
11901190func (a * agent ) createOrUpdateNetwork (manifestOK , networkOK * checkpoint ) func (context.Context , proto.DRPCAgentClient26 ) error {
1191- return func (ctx context.Context , _ proto.DRPCAgentClient26 ) (retErr error ) {
1191+ return func (ctx context.Context , aAPI proto.DRPCAgentClient26 ) (retErr error ) {
11921192 if err := manifestOK .wait (ctx ); err != nil {
11931193 return xerrors .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
13561357func (a * agent ) createTailnet (
13571358 ctx context.Context ,
1359+ aAPI proto.DRPCAgentClient26 ,
13581360 agentID uuid.UUID ,
13591361 derpMap * tailcfg.DERPMap ,
13601362 derpForceWebSockets , disableDirectConnections bool ,
@@ -1487,7 +1489,7 @@ func (a *agent) createTailnet(
14871489 }()
14881490 if err = a .trackGoroutine (func () {
14891491 defer apiListener .Close ()
1490- apiHandler , closeAPIHAndler := a .apiHandler ()
1492+ apiHandler , closeAPIHAndler := a .apiHandler (aAPI )
14911493 defer func () {
14921494 _ = closeAPIHAndler ()
14931495 }()
0 commit comments