Skip to content

Commit 74c4553

Browse files
authored
fix(codersdk): always dial agents with WorkspaceAgentIP (#8760)
1 parent 7b08be8 commit 74c4553

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

codersdk/workspaceagents.go

+5
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, opti
397397

398398
agentConn = NewWorkspaceAgentConn(conn, WorkspaceAgentConnOptions{
399399
AgentID: agentID,
400+
// Newer agents will listen on two IPs: WorkspaceAgentIP and an IP
401+
// derived from the agents UUID. We need to use the legacy
402+
// WorkspaceAgentIP here since we don't know if the agent is listening
403+
// on the new IP.
404+
AgentIP: WorkspaceAgentIP,
400405
CloseFunc: func() error {
401406
cancel()
402407
<-closedCoordinator

0 commit comments

Comments
 (0)