Skip to content
Merged
Prev Previous commit
Next Next commit
progress
  • Loading branch information
deansheather committed Nov 28, 2023
commit 7f7d7016828476136c9d00822c09f58d6318e0cb
3 changes: 1 addition & 2 deletions coderd/agentapi/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/tailnet"
tailnetproto "github.com/coder/coder/v2/tailnet/proto"
)

type ManifestAPI struct {
Expand Down Expand Up @@ -144,7 +143,7 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
DisableDirectConnections: a.DisableDirectConnections,
DerpForceWebsockets: a.DerpForceWebSockets,

DerpMap: tailnetproto.DERPMapToProto(a.DerpMapFn()),
DerpMap: tailnet.DERPMapToProto(a.DerpMapFn()),
Scripts: agentproto.DBAgentScriptsToProto(scripts),
Apps: apps,
Metadata: agentproto.DBAgentMetadataToProtoDescription(metadata),
Expand Down
2 changes: 1 addition & 1 deletion coderd/agentapi/tailnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (a *TailnetAPI) StreamDERPMaps(_ *tailnetproto.StreamDERPMapsRequest, strea
for {
derpMap := a.DerpMapFn()
if lastDERPMap == nil || !tailnet.CompareDERPMaps(lastDERPMap, derpMap) {
protoDERPMap := tailnetproto.DERPMapToProto(derpMap)
protoDERPMap := tailnet.DERPMapToProto(derpMap)
err := stream.Send(protoDERPMap)
if err != nil {
return xerrors.Errorf("send derp map: %w", err)
Expand Down
5 changes: 2 additions & 3 deletions coderd/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/tailnet"
tailnetproto "github.com/coder/coder/v2/tailnet/proto"
)

// @Summary Get workspace agent by ID
Expand Down Expand Up @@ -157,7 +156,7 @@ func (api *API) workspaceAgentRPC(rw http.ResponseWriter, r *http.Request) {
resource, err := api.Database.GetWorkspaceResourceByID(ctx, workspaceAgent.ResourceID)
if err != nil {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Failed to accept websocket.",
Message: "Internal error fetching workspace agent resource.",
Detail: err.Error(),
})
return
Expand Down Expand Up @@ -495,7 +494,7 @@ func (api *API) workspaceAgentManifest(rw http.ResponseWriter, r *http.Request)
AgentID: workspaceAgent.ID,
Apps: apps,
Scripts: scripts,
DERPMap: tailnetproto.DERPMapFromProto(manifest.DerpMap),
DERPMap: tailnet.DERPMapFromProto(manifest.DerpMap),
DERPForceWebSockets: manifest.DerpForceWebsockets,
GitAuthConfigs: int(manifest.GitAuthConfigs),
EnvironmentVariables: manifest.EnvironmentVariables,
Expand Down
2 changes: 1 addition & 1 deletion tailnet/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestDERPMap(t *testing.T) {
require.NoError(t, err)

derpMap := &tailcfg.DERPMap{}
err = json.Unmarshal([]byte(tailscaleDERPMap), derpMap)
err = json.Unmarshal(tailscaleDERPMap, derpMap)
require.NoError(t, err)

// The tailscale DERPMap doesn't have HomeParams.
Expand Down