Skip to content

chore(codersdk): move all tailscale imports out of codersdk #12735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Prev Previous commit
Next Next commit
remove all workspace prefixes from workspacesdk
  • Loading branch information
coadler committed Mar 25, 2024
commit 9f61acb6d149897c6e9bd739f9f8a6c8989d32f7
14 changes: 7 additions & 7 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ func (a *agent) wireguardAddresses(agentID uuid.UUID) []netip.Prefix {
netip.PrefixFrom(tailnet.IPFromUUID(agentID), 128),
// We also listen on the legacy codersdk.WorkspaceAgentIP. This
// allows for a transition away from wsconncache.
netip.PrefixFrom(workspacesdk.WorkspaceAgentIP, 128),
netip.PrefixFrom(workspacesdk.AgentIP, 128),
}
}

Expand Down Expand Up @@ -1147,7 +1147,7 @@ func (a *agent) createTailnet(ctx context.Context, agentID uuid.UUID, derpMap *t
}
}()

sshListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.WorkspaceAgentSSHPort))
sshListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.AgentSSHPort))
if err != nil {
return nil, xerrors.Errorf("listen on the ssh port: %w", err)
}
Expand All @@ -1162,7 +1162,7 @@ func (a *agent) createTailnet(ctx context.Context, agentID uuid.UUID, derpMap *t
return nil, err
}

reconnectingPTYListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.WorkspaceAgentReconnectingPTYPort))
reconnectingPTYListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.AgentReconnectingPTYPort))
if err != nil {
return nil, xerrors.Errorf("listen for reconnecting pty: %w", err)
}
Expand Down Expand Up @@ -1211,7 +1211,7 @@ func (a *agent) createTailnet(ctx context.Context, agentID uuid.UUID, derpMap *t
if err != nil {
return
}
var msg workspacesdk.WorkspaceAgentReconnectingPTYInit
var msg workspacesdk.AgentReconnectingPTYInit
err = json.Unmarshal(data, &msg)
if err != nil {
logger.Warn(ctx, "failed to unmarshal init", slog.F("raw", data))
Expand All @@ -1225,7 +1225,7 @@ func (a *agent) createTailnet(ctx context.Context, agentID uuid.UUID, derpMap *t
return nil, err
}

speedtestListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.WorkspaceAgentSpeedtestPort))
speedtestListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.AgentSpeedtestPort))
if err != nil {
return nil, xerrors.Errorf("listen for speedtest: %w", err)
}
Expand Down Expand Up @@ -1273,7 +1273,7 @@ func (a *agent) createTailnet(ctx context.Context, agentID uuid.UUID, derpMap *t
return nil, err
}

apiListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.WorkspaceAgentHTTPAPIServerPort))
apiListener, err := network.Listen("tcp", ":"+strconv.Itoa(workspacesdk.AgentHTTPAPIServerPort))
if err != nil {
return nil, xerrors.Errorf("api listener: %w", err)
}
Expand Down Expand Up @@ -1386,7 +1386,7 @@ func (a *agent) runDERPMapSubscriber(ctx context.Context, conn drpc.Conn, networ
}
}

func (a *agent) handleReconnectingPTY(ctx context.Context, logger slog.Logger, msg workspacesdk.WorkspaceAgentReconnectingPTYInit, conn net.Conn) (retErr error) {
func (a *agent) handleReconnectingPTY(ctx context.Context, logger slog.Logger, msg workspacesdk.AgentReconnectingPTYInit, conn net.Conn) (retErr error) {
defer conn.Close()
a.metrics.connectionsTotal.Add(1)

Expand Down
8 changes: 4 additions & 4 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ func TestAgent_UpdatedDERP(t *testing.T) {
})

// Setup a client connection.
newClientConn := func(derpMap *tailcfg.DERPMap, name string) *workspacesdk.WorkspaceAgentConn {
newClientConn := func(derpMap *tailcfg.DERPMap, name string) *workspacesdk.AgentConn {
conn, err := tailnet.NewConn(&tailnet.Options{
Addresses: []netip.Prefix{netip.PrefixFrom(tailnet.IP(), 128)},
DERPMap: derpMap,
Expand Down Expand Up @@ -1812,7 +1812,7 @@ func TestAgent_UpdatedDERP(t *testing.T) {
// Force DERP.
conn.SetBlockEndpoints(true)

sdkConn := workspacesdk.NewWorkspaceAgentConn(conn, workspacesdk.WorkspaceAgentConnOptions{
sdkConn := workspacesdk.NewAgentConn(conn, workspacesdk.AgentConnOptions{
AgentID: agentID,
CloseFunc: func() error { return workspacesdk.ErrSkipClose },
})
Expand Down Expand Up @@ -2223,7 +2223,7 @@ func setupSSHSession(
}

func setupAgent(t *testing.T, metadata agentsdk.Manifest, ptyTimeout time.Duration, opts ...func(*agenttest.Client, *agent.Options)) (
*workspacesdk.WorkspaceAgentConn,
*workspacesdk.AgentConn,
*agenttest.Client,
<-chan *proto.Stats,
afero.Fs,
Expand Down Expand Up @@ -2296,7 +2296,7 @@ func setupAgent(t *testing.T, metadata agentsdk.Manifest, ptyTimeout time.Durati
t.Logf("error closing in-mem coordination: %s", err.Error())
}
})
agentConn := workspacesdk.NewWorkspaceAgentConn(conn, workspacesdk.WorkspaceAgentConnOptions{
agentConn := workspacesdk.NewAgentConn(conn, workspacesdk.AgentConnOptions{
AgentID: metadata.AgentID,
})
t.Cleanup(func() {
Expand Down
2 changes: 1 addition & 1 deletion agent/ports_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentL
seen := make(map[uint16]struct{}, len(tabs))
ports := []codersdk.WorkspaceAgentListeningPort{}
for _, tab := range tabs {
if tab.LocalAddr == nil || tab.LocalAddr.Port < workspacesdk.WorkspaceAgentMinimumListeningPort {
if tab.LocalAddr == nil || tab.LocalAddr.Port < workspacesdk.AgentMinimumListeningPort {
continue
}

Expand Down
10 changes: 5 additions & 5 deletions cli/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func TestWorkspaceAgent(t *testing.T) {
if assert.NotEmpty(t, workspace.LatestBuild.Resources) && assert.NotEmpty(t, resources[0].Agents) {
assert.NotEmpty(t, resources[0].Agents[0].Version)
}
dialer, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, nil)
dialer, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, nil)
require.NoError(t, err)
defer dialer.Close()
require.True(t, dialer.AwaitReachable(ctx))
Expand Down Expand Up @@ -132,8 +132,8 @@ func TestWorkspaceAgent(t *testing.T) {
if assert.NotEmpty(t, resources) && assert.NotEmpty(t, resources[0].Agents) {
assert.NotEmpty(t, resources[0].Agents[0].Version)
}
dialer, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, nil)
dialer, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, nil)
require.NoError(t, err)
defer dialer.Close()
require.True(t, dialer.AwaitReachable(ctx))
Expand Down Expand Up @@ -176,7 +176,7 @@ func TestWorkspaceAgent(t *testing.T) {
if assert.NotEmpty(t, resources) && assert.NotEmpty(t, resources[0].Agents) {
assert.NotEmpty(t, resources[0].Agents[0].Version)
}
dialer, err := workspacesdk.NewWorkspaceClient(client).DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, nil)
dialer, err := workspacesdk.NewClient(client).DialAgent(ctx, resources[0].Agents[0].ID, nil)
require.NoError(t, err)
defer dialer.Close()
require.True(t, dialer.AwaitReachable(ctx))
Expand Down
4 changes: 2 additions & 2 deletions cli/configssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func TestConfigSSH(t *testing.T) {
}).WithAgent().Do()
_ = agenttest.New(t, client.URL, r.AgentToken)
resources := coderdtest.AwaitWorkspaceAgents(t, client, r.Workspace.ID)
agentConn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(context.Background(), resources[0].Agents[0].ID, nil)
agentConn, err := workspacesdk.NewClient(client).
DialAgent(context.Background(), resources[0].Agents[0].ID, nil)
require.NoError(t, err)
defer agentConn.Close()

Expand Down
2 changes: 1 addition & 1 deletion cli/exp_scaletest.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
if runCommand != "" {
config.ReconnectingPTY = &reconnectingpty.Config{
// AgentID is set by the test automatically.
Init: workspacesdk.WorkspaceAgentReconnectingPTYInit{
Init: workspacesdk.AgentReconnectingPTYInit{
ID: uuid.Nil,
Height: 24,
Width: 80,
Expand Down
2 changes: 1 addition & 1 deletion cli/netcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (r *RootCmd) netcheck() *serpent.Command {
ctx, cancel := context.WithTimeout(inv.Context(), 30*time.Second)
defer cancel()

connInfo, err := workspacesdk.NewWorkspaceClient(client).WorkspaceAgentConnectionInfoGeneric(ctx)
connInfo, err := workspacesdk.NewClient(client).AgentConnectionInfoGeneric(ctx)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cli/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func (r *RootCmd) ping() *serpent.Command {
if r.disableDirect {
_, _ = fmt.Fprintln(inv.Stderr, "Direct connections disabled.")
}
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, workspaceAgent.ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, workspaceAgent.ID, &workspacesdk.DialAgentOptions{
Logger: logger,
BlockEndpoints: r.disableDirect,
})
Expand Down
6 changes: 3 additions & 3 deletions cli/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func (r *RootCmd) portForward() *serpent.Command {
if r.disableDirect {
_, _ = fmt.Fprintln(inv.Stderr, "Direct connections disabled.")
}
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, workspaceAgent.ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, workspaceAgent.ID, &workspacesdk.DialAgentOptions{
Logger: logger,
BlockEndpoints: r.disableDirect,
})
Expand Down Expand Up @@ -195,7 +195,7 @@ func (r *RootCmd) portForward() *serpent.Command {
func listenAndPortForward(
ctx context.Context,
inv *serpent.Invocation,
conn *workspacesdk.WorkspaceAgentConn,
conn *workspacesdk.AgentConn,
wg *sync.WaitGroup,
spec portForwardSpec,
logger slog.Logger,
Expand Down
4 changes: 2 additions & 2 deletions cli/speedtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (r *RootCmd) speedtest() *serpent.Command {
if r.disableDirect {
_, _ = fmt.Fprintln(inv.Stderr, "Direct connections disabled.")
}
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, workspaceAgent.ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, workspaceAgent.ID, &workspacesdk.DialAgentOptions{
Logger: logger,
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cli/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ func (r *RootCmd) ssh() *serpent.Command {
if r.disableDirect {
_, _ = fmt.Fprintln(inv.Stderr, "Direct connections disabled.")
}
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, workspaceAgent.ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, workspaceAgent.ID, &workspacesdk.DialAgentOptions{
Logger: logger,
BlockEndpoints: r.disableDirect,
})
Expand Down
2 changes: 1 addition & 1 deletion cli/support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func assertBundleContents(t *testing.T, path string, badValues ...string) {
bs := readBytesFromZip(t, f)
require.NotEmpty(t, bs, "tailnet debug should not be empty")
case "network/netcheck.json":
var v workspacesdk.WorkspaceAgentConnectionInfo
var v workspacesdk.AgentConnectionInfo
decodeJSONFromZip(t, f, &v)
require.NotEmpty(t, v, "connection info should not be empty")
case "workspace/workspace.json":
Expand Down
6 changes: 3 additions & 3 deletions cli/vscodessh.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func (r *RootCmd) vscodeSSH() *serpent.Command {
if r.disableDirect {
logger.Info(ctx, "direct connections disabled")
}
agentConn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, workspaceAgent.ID, &workspacesdk.DialWorkspaceAgentOptions{
agentConn, err := workspacesdk.NewClient(client).
DialAgent(ctx, workspaceAgent.ID, &workspacesdk.DialAgentOptions{
Logger: logger,
BlockEndpoints: r.disableDirect,
})
Expand Down Expand Up @@ -282,7 +282,7 @@ type sshNetworkStats struct {
DownloadBytesSec int64 `json:"download_bytes_sec"`
}

func collectNetworkStats(ctx context.Context, agentConn *workspacesdk.WorkspaceAgentConn, start, end time.Time, counts map[netlogtype.Connection]netlogtype.Counts) (*sshNetworkStats, error) {
func collectNetworkStats(ctx context.Context, agentConn *workspacesdk.AgentConn, start, end time.Time, counts map[netlogtype.Connection]netlogtype.Counts) (*sshNetworkStats, error) {
latency, p2p, pingResult, err := agentConn.Ping(ctx)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions coderd/activitybump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ func TestWorkspaceActivityBump(t *testing.T) {
client, workspace, assertBumped := setupActivityTest(t)

resources := coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialAgentOptions{
Logger: slogtest.Make(t, nil),
})
require.NoError(t, err)
Expand Down Expand Up @@ -204,8 +204,8 @@ func TestWorkspaceActivityBump(t *testing.T) {

// Bump by dialing the workspace and sending traffic.
resources := coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialAgentOptions{
Logger: slogtest.Make(t, nil),
})
require.NoError(t, err)
Expand Down
8 changes: 4 additions & 4 deletions coderd/coderd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ func TestDERPForceWebSockets(t *testing.T) {
t.Cleanup(func() {
client.HTTPClient.CloseIdleConnections()
})
wsclient := workspacesdk.NewWorkspaceClient(client)
wsclient := workspacesdk.NewClient(client)
user := coderdtest.CreateFirstUser(t, client)

gen, err := wsclient.WorkspaceAgentConnectionInfoGeneric(context.Background())
gen, err := wsclient.AgentConnectionInfoGeneric(context.Background())
require.NoError(t, err)
t.Log(spew.Sdump(gen))

Expand All @@ -215,8 +215,8 @@ func TestDERPForceWebSockets(t *testing.T) {
defer cancel()

resources := coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)
conn, err := wsclient.DialWorkspaceAgent(ctx, resources[0].Agents[0].ID,
&workspacesdk.DialWorkspaceAgentOptions{
conn, err := wsclient.DialAgent(ctx, resources[0].Agents[0].ID,
&workspacesdk.DialAgentOptions{
Logger: slogtest.Make(t, nil).Leveled(slog.LevelDebug).Named("client"),
},
)
Expand Down
12 changes: 6 additions & 6 deletions coderd/insights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func TestDeploymentInsights(t *testing.T) {
require.NoError(t, err)
assert.NotZero(t, res.Workspaces[0].LastUsedAt)

conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialAgentOptions{
Logger: slogtest.Make(t, nil).Named("tailnet"),
})
require.NoError(t, err)
Expand Down Expand Up @@ -176,8 +176,8 @@ func TestUserActivityInsights_SanityCheck(t *testing.T) {
defer cancel()

// Connect to the agent to generate usage/latency stats.
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialAgentOptions{
Logger: logger.Named("client"),
})
require.NoError(t, err)
Expand Down Expand Up @@ -274,8 +274,8 @@ func TestUserLatencyInsights(t *testing.T) {
defer cancel()

// Connect to the agent to generate usage/latency stats.
conn, err := workspacesdk.NewWorkspaceClient(client).
DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialWorkspaceAgentOptions{
conn, err := workspacesdk.NewClient(client).
DialAgent(ctx, resources[0].Agents[0].ID, &workspacesdk.DialAgentOptions{
Logger: logger.Named("client"),
})
require.NoError(t, err)
Expand Down
6 changes: 3 additions & 3 deletions coderd/tailnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ func (s *ServerTailnet) acquireTicket(agentID uuid.UUID) (release func()) {
}
}

func (s *ServerTailnet) AgentConn(ctx context.Context, agentID uuid.UUID) (*workspacesdk.WorkspaceAgentConn, func(), error) {
func (s *ServerTailnet) AgentConn(ctx context.Context, agentID uuid.UUID) (*workspacesdk.AgentConn, func(), error) {
var (
conn *workspacesdk.WorkspaceAgentConn
conn *workspacesdk.AgentConn
ret func()
)

Expand All @@ -440,7 +440,7 @@ func (s *ServerTailnet) AgentConn(ctx context.Context, agentID uuid.UUID) (*work
}
ret = s.acquireTicket(agentID)

conn = workspacesdk.NewWorkspaceAgentConn(s.conn, workspacesdk.WorkspaceAgentConnOptions{
conn = workspacesdk.NewAgentConn(s.conn, workspacesdk.AgentConnOptions{
AgentID: agentID,
CloseFunc: func() error { return workspacesdk.ErrSkipClose },
})
Expand Down
10 changes: 5 additions & 5 deletions coderd/tailnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestServerTailnet_ReverseProxy(t *testing.T) {
agents, serverTailnet := setupServerTailnetAgent(t, 1)
a := agents[0]

u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.WorkspaceAgentHTTPAPIServerPort))
u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.AgentHTTPAPIServerPort))
require.NoError(t, err)

rp := serverTailnet.ReverseProxy(u, u, a.id)
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestServerTailnet_ReverseProxy(t *testing.T) {
registry := prometheus.NewRegistry()
require.NoError(t, registry.Register(serverTailnet))

u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.WorkspaceAgentHTTPAPIServerPort))
u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.AgentHTTPAPIServerPort))
require.NoError(t, err)

rp := serverTailnet.ReverseProxy(u, u, a.id)
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestServerTailnet_ReverseProxy(t *testing.T) {
agents, serverTailnet := setupServerTailnetAgent(t, 1)
a := agents[0]

u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.WorkspaceAgentHTTPAPIServerPort))
u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.AgentHTTPAPIServerPort))
require.NoError(t, err)

rp := serverTailnet.ReverseProxy(u, u, a.id)
Expand All @@ -156,7 +156,7 @@ func TestServerTailnet_ReverseProxy(t *testing.T) {
// Ensure the reverse proxy director rewrites the url host to the agent's IP.
rp.Director(req)
assert.Equal(t,
fmt.Sprintf("[%s]:%d", tailnet.IPFromUUID(a.id).String(), workspacesdk.WorkspaceAgentHTTPAPIServerPort),
fmt.Sprintf("[%s]:%d", tailnet.IPFromUUID(a.id).String(), workspacesdk.AgentHTTPAPIServerPort),
req.URL.Host,
)
})
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestServerTailnet_ReverseProxy(t *testing.T) {

require.True(t, serverTailnet.Conn().GetBlockEndpoints(), "expected BlockEndpoints to be set")

u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.WorkspaceAgentHTTPAPIServerPort))
u, err := url.Parse(fmt.Sprintf("http://127.0.0.1:%d", workspacesdk.AgentHTTPAPIServerPort))
require.NoError(t, err)

rp := serverTailnet.ReverseProxy(u, u, a.id)
Expand Down
Loading