Skip to content

Commit a456c22

Browse files
deansheatherethanndickson
authored andcommitted
chore: add test for coord rolling restart
1 parent bcd68ee commit a456c22

File tree

4 files changed

+354
-5
lines changed

4 files changed

+354
-5
lines changed

coderd/coderd.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,9 +1399,6 @@ func (api *API) Close() error {
13991399
default:
14001400
api.cancel()
14011401
}
1402-
if api.derpCloseFunc != nil {
1403-
api.derpCloseFunc()
1404-
}
14051402

14061403
wsDone := make(chan struct{})
14071404
timer := time.NewTimer(10 * time.Second)
@@ -1427,11 +1424,14 @@ func (api *API) Close() error {
14271424
api.updateChecker.Close()
14281425
}
14291426
_ = api.workspaceAppServer.Close()
1427+
_ = api.agentProvider.Close()
1428+
if api.derpCloseFunc != nil {
1429+
api.derpCloseFunc()
1430+
}
14301431
coordinator := api.TailnetCoordinator.Load()
14311432
if coordinator != nil {
14321433
_ = (*coordinator).Close()
14331434
}
1434-
_ = api.agentProvider.Close()
14351435
_ = api.statsReporter.Close()
14361436
_ = api.NetworkTelemetryBatcher.Close()
14371437
return nil

coderd/database/dbauthz/dbauthz.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ var (
254254
rbac.ResourceNotificationPreference.Type: {policy.ActionCreate, policy.ActionUpdate, policy.ActionDelete},
255255
rbac.ResourceNotificationTemplate.Type: {policy.ActionCreate, policy.ActionUpdate, policy.ActionDelete},
256256
rbac.ResourceCryptoKey.Type: {policy.ActionCreate, policy.ActionUpdate, policy.ActionDelete},
257+
rbac.ResourceTailnetCoordinator.Type: {policy.ActionCreate, policy.ActionUpdate, policy.ActionDelete},
257258
}),
258259
Org: map[string][]rbac.Permission{},
259260
User: []rbac.Permission{},

enterprise/tailnet/pgcoord.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ func newBinder(ctx context.Context,
506506

507507
b.logger.Debug(b.ctx, "updating peers to lost")
508508

509-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
509+
//nolint:gocritic // provisioner is system
510+
ctx, cancel := context.WithTimeout(dbauthz.AsSystemRestricted(context.Background()), time.Second*15)
510511
defer cancel()
511512
err := b.store.UpdateTailnetPeerStatusByCoordinator(ctx, database.UpdateTailnetPeerStatusByCoordinatorParams{
512513
CoordinatorID: b.coordinatorID,

0 commit comments

Comments
 (0)