Skip to content

chore: remove tailnet from agent API and rename client API to tailnet #11303

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 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 15 additions & 34 deletions agent/proto/agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions agent/proto/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,4 @@ service Agent {
rpc UpdateStartup(UpdateStartupRequest) returns (Startup);
rpc BatchUpdateMetadata(BatchUpdateMetadataRequest) returns (BatchUpdateMetadataResponse);
rpc BatchCreateLogs(BatchCreateLogsRequest) returns (BatchCreateLogsResponse);

rpc StreamDERPMaps(tailnet.v2.StreamDERPMapsRequest) returns (stream tailnet.v2.DERPMap);
rpc CoordinateTailnet(stream tailnet.v2.CoordinateRequest) returns (stream tailnet.v2.CoordinateResponse);
}
150 changes: 1 addition & 149 deletions agent/proto/agent_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions coderd/agentapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type API struct {
*AppsAPI
*MetadataAPI
*LogsAPI
*TailnetAPI

mu sync.Mutex
cachedWorkspaceID uuid.UUID
Expand Down Expand Up @@ -146,12 +145,6 @@ func New(opts Options) *API {
PublishWorkspaceAgentLogsUpdateFn: opts.PublishWorkspaceAgentLogsUpdateFn,
}

api.TailnetAPI = &TailnetAPI{
Ctx: opts.Ctx,
DerpMapFn: opts.DerpMapFn,
DerpMapUpdateFrequency: opts.DerpMapUpdateFrequency,
}

return api
}

Expand Down
53 changes: 0 additions & 53 deletions coderd/agentapi/tailnet.go

This file was deleted.

4 changes: 2 additions & 2 deletions tailnet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/coder/coder/v2/tailnet/proto"
)

func NewDRPCClient(conn net.Conn) (proto.DRPCClientClient, error) {
func NewDRPCClient(conn net.Conn) (proto.DRPCTailnetClient, error) {
config := yamux.DefaultConfig()
config.LogOutput = io.Discard
session, err := yamux.Client(conn, config)
if err != nil {
return nil, xerrors.Errorf("multiplex client: %w", err)
}
return proto.NewDRPCClientClient(drpc.MultiplexedConn(session)), nil
return proto.NewDRPCTailnetClient(drpc.MultiplexedConn(session)), nil
}
Loading