mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-19 05:02:34 +00:00
tstest/integration/testcontrol: add Server.nodeLocked
This commit is contained in:
parent
aa6abc98f3
commit
58cc2cc921
@ -176,6 +176,13 @@ func (s *Server) serveMachine(w http.ResponseWriter, r *http.Request) {
|
|||||||
func (s *Server) Node(nodeKey tailcfg.NodeKey) *tailcfg.Node {
|
func (s *Server) Node(nodeKey tailcfg.NodeKey) *tailcfg.Node {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
return s.nodeLocked(nodeKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
// nodeLocked returns the node for nodeKey. It's always nil or cloned memory.
|
||||||
|
//
|
||||||
|
// s.mu must be held.
|
||||||
|
func (s *Server) nodeLocked(nodeKey tailcfg.NodeKey) *tailcfg.Node {
|
||||||
return s.nodes[nodeKey].Clone()
|
return s.nodes[nodeKey].Clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user