MCPcopy Index your code
hub / github.com/coder/coder / RemoveDestination

Method RemoveDestination

tailnet/controllers.go:471–492  ·  view source on GitHub ↗
(dest uuid.UUID)

Source from the content-addressed store, hash-verified

469}
470
471func (c *TunnelSrcCoordController) RemoveDestination(dest uuid.UUID) {
472 c.mu.Lock()
473 defer c.mu.Unlock()
474 delete(c.dests, dest)
475 if c.coordination == nil {
476 return
477 }
478 err := c.coordination.SendRequest(
479 &proto.CoordinateRequest{
480 RemoveTunnel: &proto.CoordinateRequest_Tunnel{Id: UUIDToByteSlice(dest)},
481 })
482 if err != nil {
483 c.coordination.SendErr(err)
484 cErr := c.coordination.client.Close() // close the client so we don't gracefully disconnect
485 if cErr != nil {
486 c.Logger.Debug(context.Background(),
487 "failed to close coordinator client after remove tunnel failure",
488 slog.Error(cErr))
489 }
490 c.coordination = nil
491 }
492}
493
494func (c *TunnelSrcCoordController) SyncDestinations(destinations []uuid.UUID) {
495 c.mu.Lock()

Calls 7

UUIDToByteSliceFunction · 0.85
SendRequestMethod · 0.80
SendErrMethod · 0.80
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
ErrorMethod · 0.45