@@ -1188,7 +1188,7 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
1188
1188
// createOrUpdateNetwork waits for the manifest to be set using manifestOK, then creates or updates
1189
1189
// the tailnet using the information in the manifest
1190
1190
func (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 ) {
1192
1192
if err := manifestOK .wait (ctx ); err != nil {
1193
1193
return xerrors .Errorf ("no manifest: %w" , err )
1194
1194
}
@@ -1208,6 +1208,7 @@ func (a *agent) createOrUpdateNetwork(manifestOK, networkOK *checkpoint) func(co
1208
1208
// agent API.
1209
1209
network , err = a .createTailnet (
1210
1210
a .gracefulCtx ,
1211
+ aAPI ,
1211
1212
manifest .AgentID ,
1212
1213
manifest .DERPMap ,
1213
1214
manifest .DERPForceWebSockets ,
@@ -1355,6 +1356,7 @@ func (a *agent) trackGoroutine(fn func()) error {
1355
1356
1356
1357
func (a * agent ) createTailnet (
1357
1358
ctx context.Context ,
1359
+ aAPI proto.DRPCAgentClient26 ,
1358
1360
agentID uuid.UUID ,
1359
1361
derpMap * tailcfg.DERPMap ,
1360
1362
derpForceWebSockets , disableDirectConnections bool ,
@@ -1487,7 +1489,7 @@ func (a *agent) createTailnet(
1487
1489
}()
1488
1490
if err = a .trackGoroutine (func () {
1489
1491
defer apiListener .Close ()
1490
- apiHandler , closeAPIHAndler := a .apiHandler ()
1492
+ apiHandler , closeAPIHAndler := a .apiHandler (aAPI )
1491
1493
defer func () {
1492
1494
_ = closeAPIHAndler ()
1493
1495
}()
0 commit comments