@@ -22,7 +22,6 @@ import (
22
22
"github.com/coder/coder/v2/coderd/httpmw"
23
23
"github.com/coder/coder/v2/coderd/workspaceapps"
24
24
"github.com/coder/coder/v2/codersdk"
25
- "github.com/coder/coder/v2/tailnet"
26
25
agpl "github.com/coder/coder/v2/tailnet"
27
26
)
28
27
@@ -423,14 +422,14 @@ const (
423
422
type CoordinateMessage struct {
424
423
Type CoordinateMessageType `json:"type"`
425
424
AgentID uuid.UUID `json:"agent_id"`
426
- Node * tailnet .Node `json:"node"`
425
+ Node * agpl .Node `json:"node"`
427
426
}
428
427
429
428
type CoordinateNodes struct {
430
- Nodes []* tailnet .Node
429
+ Nodes []* agpl .Node
431
430
}
432
431
433
- func (c * Client ) DialCoordinator (ctx context.Context ) (tailnet .MultiAgentConn , error ) {
432
+ func (c * Client ) DialCoordinator (ctx context.Context ) (agpl .MultiAgentConn , error ) {
434
433
ctx , cancel := context .WithCancel (ctx )
435
434
436
435
coordinateURL , err := c .SDKClient .URL .Parse ("/api/v2/workspaceproxies/me/coordinate" )
@@ -464,7 +463,7 @@ func (c *Client) DialCoordinator(ctx context.Context) (tailnet.MultiAgentConn, e
464
463
legacyAgentCache : map [uuid.UUID ]bool {},
465
464
}
466
465
467
- ma := (& tailnet .MultiAgent {
466
+ ma := (& agpl .MultiAgent {
468
467
ID : uuid .New (),
469
468
AgentIsLegacyFunc : rma .AgentIsLegacy ,
470
469
OnSubscribe : rma .OnSubscribe ,
@@ -516,7 +515,7 @@ func (a *remoteMultiAgentHandler) writeJSON(v interface{}) error {
516
515
517
516
// Set a deadline so that hung connections don't put back pressure on the system.
518
517
// Node updates are tiny, so even the dinkiest connection can handle them if it's not hung.
519
- err = a .nc .SetWriteDeadline (time .Now ().Add (tailnet .WriteTimeout ))
518
+ err = a .nc .SetWriteDeadline (time .Now ().Add (agpl .WriteTimeout ))
520
519
if err != nil {
521
520
return xerrors .Errorf ("set write deadline: %w" , err )
522
521
}
@@ -538,21 +537,21 @@ func (a *remoteMultiAgentHandler) writeJSON(v interface{}) error {
538
537
return nil
539
538
}
540
539
541
- func (a * remoteMultiAgentHandler ) OnNodeUpdate (_ uuid.UUID , node * tailnet .Node ) error {
540
+ func (a * remoteMultiAgentHandler ) OnNodeUpdate (_ uuid.UUID , node * agpl .Node ) error {
542
541
return a .writeJSON (CoordinateMessage {
543
542
Type : CoordinateMessageTypeNodeUpdate ,
544
543
Node : node ,
545
544
})
546
545
}
547
546
548
- func (a * remoteMultiAgentHandler ) OnSubscribe (_ tailnet .Queue , agentID uuid.UUID ) (* tailnet .Node , error ) {
547
+ func (a * remoteMultiAgentHandler ) OnSubscribe (_ agpl .Queue , agentID uuid.UUID ) (* agpl .Node , error ) {
549
548
return nil , a .writeJSON (CoordinateMessage {
550
549
Type : CoordinateMessageTypeSubscribe ,
551
550
AgentID : agentID ,
552
551
})
553
552
}
554
553
555
- func (a * remoteMultiAgentHandler ) OnUnsubscribe (_ tailnet .Queue , agentID uuid.UUID ) error {
554
+ func (a * remoteMultiAgentHandler ) OnUnsubscribe (_ agpl .Queue , agentID uuid.UUID ) error {
556
555
return a .writeJSON (CoordinateMessage {
557
556
Type : CoordinateMessageTypeUnsubscribe ,
558
557
AgentID : agentID ,
0 commit comments