-
Notifications
You must be signed in to change notification settings - Fork 881
feat: modify PG Coordinator to work with new v2 Tailnet API #10573
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
Conversation
79152ee
to
0e96fa3
Compare
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
0d829dd
to
504d82c
Compare
0e96fa3
to
e74a0f4
Compare
e74a0f4
to
0cbde53
Compare
06746f6
to
e9ec10d
Compare
0cbde53
to
c36befe
Compare
e9ec10d
to
b0c48ca
Compare
c36befe
to
2a2e2db
Compare
// Node returns an in-memory node by ID. | ||
Node(id uuid.UUID) *Node | ||
Close() error | ||
Coordinate(ctx context.Context, id uuid.UUID, name string, a TunnelAuth) (chan<- *proto.CoordinateRequest, <-chan *proto.CoordinateResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious on your thoughts: on public interfaces I normally like returning a wrapper with functions to access the channels instead of returning raw channels. Does that feel too abstracty for this? I could feel it being slightly verbose needing to always store two channels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good instinct, and I think it depends on how we expect it to be used. In this case, I'm imagining that we will have an object that "glues" the Coordinate() call to the drpc Stream.
e.g.
type coordinateStreamer struct {
stream proto.DRPCStream_Coordinate
reqs chan<- *proto.CoordinateRequests
resps <-chan *proto.CoordinateResponse
}
And this thing will have very simple methods that copy from the channels into the stream and vice versa.
Thus, I'm kinda already planning to wrap them up in a struct as soon as they are returned, so putting them together in a wrapper just means I have to unwrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
2a2e2db
to
63becc5
Compare
re: #10528
Refactors PG Coordinator to work with the Tailnet v2 API, including wrappers for the existing v1 API.
The debug endpoint functions, but doesn't return sensible data, that will be in another stacked PR.