Update pushes a workspace update to the manager
(update tailnet.WorkspaceUpdate)
| 364 | |
| 365 | // Update pushes a workspace update to the manager |
| 366 | func (u *updater) Update(update tailnet.WorkspaceUpdate) error { |
| 367 | u.mu.Lock() |
| 368 | defer u.mu.Unlock() |
| 369 | |
| 370 | peerUpdate := u.createPeerUpdateLocked(update) |
| 371 | msg := &TunnelMessage{ |
| 372 | Msg: &TunnelMessage_PeerUpdate{ |
| 373 | PeerUpdate: peerUpdate, |
| 374 | }, |
| 375 | } |
| 376 | select { |
| 377 | case <-u.ctx.Done(): |
| 378 | return u.ctx.Err() |
| 379 | case u.uSendCh <- msg: |
| 380 | } |
| 381 | return nil |
| 382 | } |
| 383 | |
| 384 | // sendUpdateResponse responds to the provided `ManagerMessage_GetPeerUpdate` request |
| 385 | // with the current state of the workspaces. |
nothing calls this directly
no test coverage detected