appc,ipn/ipnlocal: add a required event bus to the AppConnector type (#17390)

Require the presence of the bus, but do not use it yet.  Check for required
fields and update tests and production use to plumb the necessary arguments.

Updates #15160
Updates #17192

Change-Id: I8cefd2fdb314ca9945317d3320bd5ea6a92e8dcb
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
M. J. Fromberger
2025-10-01 12:00:32 -07:00
committed by GitHub
parent ce752b8a88
commit 67f1081269
5 changed files with 75 additions and 26 deletions
+10 -3
View File
@@ -259,12 +259,17 @@ func TestPeerAPIPrettyReplyCNAME(t *testing.T) {
if shouldStore {
a = appc.NewAppConnector(appc.Config{
Logf: t.Logf,
EventBus: sys.Bus.Get(),
RouteAdvertiser: &appctest.RouteCollector{},
RouteInfo: &appc.RouteInfo{},
StoreRoutesFunc: fakeStoreRoutes,
})
} else {
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: &appctest.RouteCollector{}})
a = appc.NewAppConnector(appc.Config{
Logf: t.Logf,
EventBus: sys.Bus.Get(),
RouteAdvertiser: &appctest.RouteCollector{},
})
}
sys.Set(pm.Store())
sys.Set(eng)
@@ -339,12 +344,13 @@ func TestPeerAPIReplyToDNSQueriesAreObserved(t *testing.T) {
if shouldStore {
a = appc.NewAppConnector(appc.Config{
Logf: t.Logf,
EventBus: sys.Bus.Get(),
RouteAdvertiser: rc,
RouteInfo: &appc.RouteInfo{},
StoreRoutesFunc: fakeStoreRoutes,
})
} else {
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: rc})
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, EventBus: sys.Bus.Get(), RouteAdvertiser: rc})
}
sys.Set(pm.Store())
sys.Set(eng)
@@ -411,12 +417,13 @@ func TestPeerAPIReplyToDNSQueriesAreObservedWithCNAMEFlattening(t *testing.T) {
if shouldStore {
a = appc.NewAppConnector(appc.Config{
Logf: t.Logf,
EventBus: sys.Bus.Get(),
RouteAdvertiser: rc,
RouteInfo: &appc.RouteInfo{},
StoreRoutesFunc: fakeStoreRoutes,
})
} else {
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: rc})
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, EventBus: sys.Bus.Get(), RouteAdvertiser: rc})
}
sys.Set(pm.Store())
sys.Set(eng)