mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
+4
-2
@@ -1918,7 +1918,8 @@ func TestAgent_UpdatedDERP(t *testing.T) {
|
||||
testCtx, testCtxCancel := context.WithCancel(context.Background())
|
||||
t.Cleanup(testCtxCancel)
|
||||
clientID := uuid.New()
|
||||
ctrl := tailnet.NewSingleDestController(logger, conn, agentID)
|
||||
ctrl := tailnet.NewTunnelSrcCoordController(logger, conn)
|
||||
ctrl.AddDestination(agentID)
|
||||
auth := tailnet.ClientCoordinateeAuth{AgentID: agentID}
|
||||
coordination := ctrl.New(tailnet.NewInMemoryCoordinatorClient(logger, clientID, auth, coordinator))
|
||||
t.Cleanup(func() {
|
||||
@@ -2408,7 +2409,8 @@ func setupAgent(t *testing.T, metadata agentsdk.Manifest, ptyTimeout time.Durati
|
||||
testCtx, testCtxCancel := context.WithCancel(context.Background())
|
||||
t.Cleanup(testCtxCancel)
|
||||
clientID := uuid.New()
|
||||
ctrl := tailnet.NewSingleDestController(logger, conn, metadata.AgentID)
|
||||
ctrl := tailnet.NewTunnelSrcCoordController(logger, conn)
|
||||
ctrl.AddDestination(metadata.AgentID)
|
||||
auth := tailnet.ClientCoordinateeAuth{AgentID: metadata.AgentID}
|
||||
coordination := ctrl.New(tailnet.NewInMemoryCoordinatorClient(
|
||||
logger, clientID, auth, coordinator))
|
||||
|
||||
Reference in New Issue
Block a user