tailscale/cmd/k8s-operator
Brad Fitzpatrick 4660a961eb ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path
Processing a peer add/remove delta still materialized the full netmap
(an O(n) slicesx.MapValues plus sort over all peers, at 10k+
peers in a large tailnet) twice per delta: once in UpdateNetmapDelta
purely to hand the self node to Engine.SetSelfNode, and once in
authReconfigLocked.

Neither needs peers anymore. SetSelfNode gets the self node from the
existing nodeBackend.Self accessor. authReconfigLocked only reads
self-node fields (SelfNode, NodeKey, GetAddresses, HasCap) now that
WireGuard peers ride the incremental route manager and per-peer config
source, so it can use the peers-free NetMap accessor.

That also makes nmcfg.WGCfg vestigial: since wgcfg.Config lost its
Peers field, its peer walk existed only to emit the [v1] skip logs
(expired peers, unselected exit nodes, unaccepted subnet routes),
duplicating filtering the route manager already does. Delete the
package and construct the two-field wgcfg.Config inline. The skip
logs go away; if they're missed, the route manager can log them
incrementally at upsert time instead of rescanning every peer on
every reconfig.

With this, the runtime.DidRange analysis (see the ts_rangehook test)
shows a delta netmap update performing no O(n) range loops except
updateRouteManagerExtras, and the delta phase of that test drops from
1.09s to 0.14s for 400 deltas at n=10000 (from 4.79s at the
start of this effort, before the incremental route manager work).

Updates #12542

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: Ia0e03ef9db0c988790b2c29de1f0505305e93f58
2026-07-15 11:21:36 -04:00
..
deploy go.mod: revert update vulnerable dependencies (#20435) (#20456) 2026-07-14 10:26:32 -06:00
e2e cmd/k8s-operator: use dynamic resource names in e2e ingress tests (#19536) 2026-04-27 13:40:46 +01:00
generate cmd/k8s-operator,k8s-operator: define ProxyGroupPolicy reconciler (#18654) 2026-02-18 09:34:55 +00:00
api-server-proxy-pg_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
api-server-proxy-pg.go cmd/k8s-operator: rework [unexpected] log lines (#20065) 2026-06-11 14:48:48 +01:00
api-server-proxy.go types/ptr: deprecate ptr.To, use Go 1.26 new 2026-03-05 20:13:18 -08:00
connector_test.go cmd/{containerboot,k8s-operator}: add 4via6 support in singleton egress (#19983) 2026-06-18 16:13:10 +01:00
connector.go cmd/{containerboot,k8s-operator}: add 4via6 support in singleton egress (#19983) 2026-06-18 16:13:10 +01:00
depaware.txt ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path 2026-07-15 11:21:36 -04:00
dnsrecords_test.go k8s-operator/dnsrecords: fix dnsRR dropping reconcile events on lock err (#19968) 2026-06-26 13:52:05 +01:00
dnsrecords.go k8s-operator/dnsrecords: fix dnsRR dropping reconcile events on lock err (#19968) 2026-06-26 13:52:05 +01:00
egress-eps_test.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-eps.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-pod-readiness_test.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-pod-readiness.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-services_test.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-services-readiness_test.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-services-readiness.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
egress-services.go cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
ingress_test.go Construct IPv6 ingress URLs correctly 2026-05-20 17:21:35 -07:00
ingress-for-pg_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
ingress-for-pg.go cmd/k8s-operator: reorder Ingress cleanup so cert loop stops before VIPService delete (#20426) 2026-07-14 12:11:56 +01:00
ingress.go Construct IPv6 ingress URLs correctly 2026-05-20 17:21:35 -07:00
logger.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
metrics_resources.go cmd: apply go fix 2026-07-10 14:26:11 -07:00
nameserver_test.go cmd/k8s-operator: add nodeSelector to DNSConfig resource (#19429) 2026-04-29 15:56:33 +01:00
nameserver.go cmd/k8s-operator: add nodeSelector to DNSConfig resource (#19429) 2026-04-29 15:56:33 +01:00
nodeport-service-ports.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
nodeport-services-ports_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
operator_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
operator.go cmd/k8s-operator: rework [unexpected] log lines (#20065) 2026-06-11 14:48:48 +01:00
proxyclass_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
proxyclass.go cmd/k8s-operator: rework [unexpected] log lines (#20065) 2026-06-11 14:48:48 +01:00
proxygroup_specs.go cmd/k8s-operator: rework [unexpected] log lines (#20065) 2026-06-11 14:48:48 +01:00
proxygroup_test.go cmd/k8s-operator: stabilize StaticEndpoints order in ProxyGroup reconciles (#19755) 2026-05-27 14:28:04 +01:00
proxygroup.go cmd/k8s-operator: stabilize StaticEndpoints order in ProxyGroup reconciles (#19755) 2026-05-27 14:28:04 +01:00
sts_test.go cmd: apply go fix 2026-07-10 14:26:11 -07:00
sts.go all: fix more typos caused by unnecessary repetition 2026-07-06 10:36:17 +01:00
svc_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
svc-for-pg_test.go cmd/k8s-operator: scope HA Service hostname check per-tailnet (#20114) 2026-06-23 14:25:11 +01:00
svc-for-pg.go cmd/k8s-operator: scope HA Service hostname check per-tailnet (#20114) 2026-06-23 14:25:11 +01:00
svc.go all: fix more typos caused by unnecessary repetition 2026-07-06 10:36:17 +01:00
testutils_test.go go.mod: revert update vulnerable dependencies (#20435) (#20456) 2026-07-14 10:26:32 -06:00
tsclient.go cmd/k8s-operator: fix token exchange for identity federation (#19845) 2026-05-27 16:45:07 +01:00
tsrecorder_specs_test.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
tsrecorder_specs.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
tsrecorder_test.go cmd/k8s-operator: add authkey reissuing to recorder reconciler (#19556) 2026-05-01 18:26:55 +01:00
tsrecorder.go cmd/k8s-operator: add authkey reissuing to recorder reconciler (#19556) 2026-05-01 18:26:55 +01:00