mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: remove legacy wsconncache (#11816)
Fixes #8218 Removes `wsconncache` and related "is legacy?" functions and API calls that were used by it. The only leftover is that Agents still use the legacy IP, so that back level clients or workspace proxies can dial them correctly. We should eventually remove this: #11819
This commit is contained in:
@@ -477,19 +477,6 @@ func ServeMultiAgent(c CoordinatorV2, logger slog.Logger, id uuid.UUID) MultiAge
|
||||
reqs, resps := c.Coordinate(ctx, id, id.String(), SingleTailnetTunnelAuth{})
|
||||
m := (&MultiAgent{
|
||||
ID: id,
|
||||
AgentIsLegacyFunc: func(agentID uuid.UUID) bool {
|
||||
if n := c.Node(agentID); n == nil {
|
||||
// If we don't have the node at all assume it's legacy for
|
||||
// safety.
|
||||
return true
|
||||
} else if len(n.Addresses) > 0 && n.Addresses[0].Addr() == legacyAgentIP {
|
||||
// An agent is determined to be "legacy" if it's first IP is the
|
||||
// legacy IP. Agents with only the legacy IP aren't compatible
|
||||
// with single_tailnet and must be routed through wsconncache.
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
OnSubscribe: func(enq Queue, agent uuid.UUID) error {
|
||||
err := SendCtx(ctx, reqs, &proto.CoordinateRequest{AddTunnel: &proto.CoordinateRequest_Tunnel{Id: UUIDToByteSlice(agent)}})
|
||||
return err
|
||||
@@ -834,10 +821,6 @@ func ServeAgentV1(ctx context.Context, logger slog.Logger, c CoordinatorV2, conn
|
||||
return nil
|
||||
}
|
||||
|
||||
// This is copied from codersdk because importing it here would cause an import
|
||||
// cycle. This is just temporary until wsconncache is phased out.
|
||||
var legacyAgentIP = netip.MustParseAddr("fd7a:115c:a1e0:49d6:b259:b7ac:b1b2:48f4")
|
||||
|
||||
// Close closes all of the open connections in the coordinator and stops the
|
||||
// coordinator from accepting new connections.
|
||||
func (c *coordinator) Close() error {
|
||||
|
||||
Reference in New Issue
Block a user