feat: add support for multiple tunnel destinations in tailnet (#15409)

Closes #14729

Expands the Coordination controller used by the CLI client to allow multiple tunnel destinations (agents).  Our current client uses just one, but this unifies the logic so that when we add Coder VPN, 1 is just a special case of "many."
This commit is contained in:
Spike Curtis
2024-11-08 13:32:07 +04:00
committed by GitHub
parent 8c00ebc6ee
commit e5661c2748
5 changed files with 530 additions and 23 deletions
+3 -1
View File
@@ -268,7 +268,9 @@ func (c *Client) DialAgent(dialCtx context.Context, agentID uuid.UUID, options *
_ = conn.Close()
}
}()
controller.CoordCtrl = tailnet.NewSingleDestController(options.Logger, conn, agentID)
coordCtrl := tailnet.NewTunnelSrcCoordController(options.Logger, conn)
coordCtrl.AddDestination(agentID)
controller.CoordCtrl = coordCtrl
controller.DERPCtrl = tailnet.NewBasicDERPController(options.Logger, conn)
controller.Run(ctx)