net/netmon: remove usage of direct callbacks from netmon (#17292)

The callback itself is not removed as it is used in other repos, making
it simpler for those to slowly transition to the eventbus.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
Claus Lensbøl
2025-10-01 14:59:38 -04:00
committed by GitHub
parent 6f7ce5eb5d
commit ce752b8a88
28 changed files with 217 additions and 48 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/go-json-experiment/json/jsontext"
"tailscale.com/tstest"
"tailscale.com/tstime"
"tailscale.com/util/eventbus/eventbustest"
"tailscale.com/util/must"
)
@@ -30,6 +31,7 @@ func TestFastShutdown(t *testing.T) {
l := NewLogger(Config{
BaseURL: testServ.URL,
Bus: eventbustest.NewBus(t),
}, t.Logf)
err := l.Shutdown(ctx)
if err != nil {
@@ -62,7 +64,10 @@ func NewLogtailTestHarness(t *testing.T) (*LogtailTestServer, *Logger) {
t.Cleanup(ts.srv.Close)
l := NewLogger(Config{BaseURL: ts.srv.URL}, t.Logf)
l := NewLogger(Config{
BaseURL: ts.srv.URL,
Bus: eventbustest.NewBus(t),
}, t.Logf)
// There is always an initial "logtail started" message
body := <-ts.uploaded