mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-23 09:06:24 +00:00
control/controlclient: introduce eventbus messages instead of callbacks (#16956)
This is a small introduction of the eventbus into controlclient that communicates with mainly ipnlocal. While ipnlocal is a complicated part of the codebase, the subscribers here are from the perspective of ipnlocal already called async. Updates #15160 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
@@ -35,6 +35,7 @@ import (
|
||||
"tailscale.com/types/key"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/logid"
|
||||
"tailscale.com/util/eventbus/eventbustest"
|
||||
"tailscale.com/util/slicesx"
|
||||
"tailscale.com/wgengine"
|
||||
)
|
||||
@@ -158,7 +159,6 @@ func TestWhoIsArgTypes(t *testing.T) {
|
||||
t.Fatalf("backend called with %v; want %v", k, keyStr)
|
||||
}
|
||||
return match()
|
||||
|
||||
},
|
||||
peerCaps: map[netip.Addr]tailcfg.PeerCapMap{
|
||||
netip.MustParseAddr("100.101.102.103"): map[tailcfg.PeerCapability][]tailcfg.RawMessage{
|
||||
@@ -336,7 +336,7 @@ func TestServeWatchIPNBus(t *testing.T) {
|
||||
|
||||
func newTestLocalBackend(t testing.TB) *ipnlocal.LocalBackend {
|
||||
var logf logger.Logf = logger.Discard
|
||||
sys := tsd.NewSystem()
|
||||
sys := tsd.NewSystemWithBus(eventbustest.NewBus(t))
|
||||
store := new(mem.Store)
|
||||
sys.Set(store)
|
||||
eng, err := wgengine.NewFakeUserspaceEngine(logf, sys.Set, sys.HealthTracker(), sys.UserMetricsRegistry(), sys.Bus.Get())
|
||||
|
||||
Reference in New Issue
Block a user