appc: factor app connector arguments into a Config type (#17389)
Replace the positional arguments to NewAppConnector with a Config struct. Update the existing uses. Other than the API change, there are no functional changes in this commit. Updates #15160 Updates #17192 Change-Id: Ibf37f021372155a4db8aaf738f4b4f2c746bf623 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
@@ -257,9 +257,14 @@ func TestPeerAPIPrettyReplyCNAME(t *testing.T) {
|
||||
pm := must.Get(newProfileManager(new(mem.Store), t.Logf, ht))
|
||||
var a *appc.AppConnector
|
||||
if shouldStore {
|
||||
a = appc.NewAppConnector(t.Logf, &appctest.RouteCollector{}, &appc.RouteInfo{}, fakeStoreRoutes)
|
||||
a = appc.NewAppConnector(appc.Config{
|
||||
Logf: t.Logf,
|
||||
RouteAdvertiser: &appctest.RouteCollector{},
|
||||
RouteInfo: &appc.RouteInfo{},
|
||||
StoreRoutesFunc: fakeStoreRoutes,
|
||||
})
|
||||
} else {
|
||||
a = appc.NewAppConnector(t.Logf, &appctest.RouteCollector{}, nil, nil)
|
||||
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: &appctest.RouteCollector{}})
|
||||
}
|
||||
sys.Set(pm.Store())
|
||||
sys.Set(eng)
|
||||
@@ -332,9 +337,14 @@ func TestPeerAPIReplyToDNSQueriesAreObserved(t *testing.T) {
|
||||
eng, _ := wgengine.NewFakeUserspaceEngine(logger.Discard, 0, ht, reg, sys.Bus.Get(), sys.Set)
|
||||
var a *appc.AppConnector
|
||||
if shouldStore {
|
||||
a = appc.NewAppConnector(t.Logf, rc, &appc.RouteInfo{}, fakeStoreRoutes)
|
||||
a = appc.NewAppConnector(appc.Config{
|
||||
Logf: t.Logf,
|
||||
RouteAdvertiser: rc,
|
||||
RouteInfo: &appc.RouteInfo{},
|
||||
StoreRoutesFunc: fakeStoreRoutes,
|
||||
})
|
||||
} else {
|
||||
a = appc.NewAppConnector(t.Logf, rc, nil, nil)
|
||||
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: rc})
|
||||
}
|
||||
sys.Set(pm.Store())
|
||||
sys.Set(eng)
|
||||
@@ -399,9 +409,14 @@ func TestPeerAPIReplyToDNSQueriesAreObservedWithCNAMEFlattening(t *testing.T) {
|
||||
pm := must.Get(newProfileManager(new(mem.Store), t.Logf, ht))
|
||||
var a *appc.AppConnector
|
||||
if shouldStore {
|
||||
a = appc.NewAppConnector(t.Logf, rc, &appc.RouteInfo{}, fakeStoreRoutes)
|
||||
a = appc.NewAppConnector(appc.Config{
|
||||
Logf: t.Logf,
|
||||
RouteAdvertiser: rc,
|
||||
RouteInfo: &appc.RouteInfo{},
|
||||
StoreRoutesFunc: fakeStoreRoutes,
|
||||
})
|
||||
} else {
|
||||
a = appc.NewAppConnector(t.Logf, rc, nil, nil)
|
||||
a = appc.NewAppConnector(appc.Config{Logf: t.Logf, RouteAdvertiser: rc})
|
||||
}
|
||||
sys.Set(pm.Store())
|
||||
sys.Set(eng)
|
||||
|
||||
Reference in New Issue
Block a user