Repository navigation
feat: add WorkspaceUpdates tailnet RPC - #14847
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ethanndickson and the rest of your teammates on |
22985f7 to
db04bcf
Compare
ddc493e to
d2d165e
Compare
db04bcf to
50f874c
Compare
d57f3e6 to
8102c71
Compare
50f874c to
fe1e8b5
Compare
8102c71 to
4f57562
Compare
fe1e8b5 to
aaf8e86
Compare
ab7f678 to
fb84465
Compare
be7fa9e to
cb5adf4
Compare
fb84465 to
1a8392d
Compare
cb5adf4 to
2bc6e69
Compare
1a8392d to
51cd615
Compare
2bc6e69 to
54cbfaf
Compare
51cd615 to
de1435d
Compare
54cbfaf to
aad36cf
Compare
de1435d to
398fa2d
Compare
aad36cf to
b5f7529
Compare
398fa2d to
077608b
Compare
b5f7529 to
fabe2d1
Compare
077608b to
c762ae8
Compare
fabe2d1 to
d89d373
Compare
There was a problem hiding this comment.
drop this tag --- it's not specifically related to agents, unlike the existing RPC which targets a specific agent.
There was a problem hiding this comment.
The swagger parser requires a tag, so it'd be between Agents or Workspaces, or perhaps a new tag?
3a95c19 to
22db890
Compare
1b030c9 to
a612298
Compare
22db890 to
c55e54b
Compare
9f86117 to
88847a3
Compare
c55e54b to
45225e4
Compare
88847a3 to
84730b8
Compare
84730b8 to
f3b74b7
Compare
There was a problem hiding this comment.
ctx isn't used anywhere, so it and cancelFn are superfluous, which I think makes Close() on this superfluous.
There was a problem hiding this comment.
The intention was for sub to store a context who's parent is updatesProvider's context, so that calling Close on the updates provider closes all the existing subscriptions - will fix.
There was a problem hiding this comment.
This needs to be the c.peerCtx --- coordCtx is the context of the Coordinator's lifetime.
You should add a test that adds a subject to a context you use to call Coordinate() and verify the subject is there on the Authorize call. Same test for the AGPL implementation.
e05b286 to
a45a43c
Compare
f3b74b7 to
d1fac01
Compare
There was a problem hiding this comment.
This was actually passing without, but it would take the entire 10 seconds. Interestingly, the PGCoord doesn't have this behaviour
There was a problem hiding this comment.
Yeah, PGCoord is more aggressive with closing things down, forcibly booting anything still connected because it has contexts plumbed thru for background tasks like heartbeats. The AGPL coordinator is considerably simpler and has no coordinator-scoped context.
964bfe9 to
494afa9
Compare
spikecurtis
left a comment
There was a problem hiding this comment.
A few nits inline, but I don't need to review again
There was a problem hiding this comment.
Yeah, PGCoord is more aggressive with closing things down, forcibly booting anything still connected because it has contexts plumbed thru for background tasks like heartbeats. The AGPL coordinator is considerably simpler and has no coordinator-scoped context.

Closes #14716
Closes #14717
Adds a new user-scoped tailnet API endpoint (
api/v2/tailnet) with a new RPC stream for receiving updates on workspaces owned by a specific user, as defined in #14716.When a stream is started, the
WorkspaceUpdatesProviderwill begin listening on the user-scoped pubsub events implemented in #14964. When a relevant event type is seen (such as a workspace state transition), the provider will query the DB for all the workspaces (and agents) owned by the user. This gets compared against the result of the previous query to produce a set of workspace updates.Workspace updates can be requested for any user ID, however only workspaces the authorised user is permitted to
ActionReadwill have their updates streamed.Opening a tunnel to an agent requires that the user can perform
ActionSSHagainst the workspace containing it.