tailscale/cmd/k8s-operator
Brad Fitzpatrick bb4f458207 feature/captiveportal: move captive portal code out of ipnlocal, netcheck
Captive portal detection was half-migrated: it had a build tag and
buildfeatures constant, but its code still lived in build-tag-gated
files in ipn/ipnlocal and net/netcheck, with its per-backend state
(context, cancel func, signaling channel) as fields on LocalBackend.

Move it under feature/captiveportal. The health-driven detection loop
becomes an ipnext.Extension holding its own state: it starts and
stops the loop from the BackendStateChange hook and subscribes to
health.Change events on the eventbus itself, removing the captive
portal hooks and special cases from LocalBackend entirely. The DERP
map now comes from a new ipnext.NodeBackend.DERPMap method, and the
preferred DERP region from magicsock's last netcheck report (the
same underlying source as the previously used Hostinfo.NetInfo).

The netcheck probe hook is now exported with a signature free of
netcheck internals, and its implementation moves to the small
feature/captiveportal/netcheckhook package, which installs the hook
as an import side effect. That package stays free of tsd/wgengine
dependencies so the tailscale CLI can keep probing for captive
portals in "tailscale netcheck" without linking the daemon-side
extension. The net/captivedetection library itself is unchanged and
stays put; after this change it is only linked when something pulls
in netcheckhook or the feature extension.

tailscaled links the feature by default via condregister as before,
but tsnet no longer does (shrinking tsnet, k8s-operator, and tsidp);
tsnet users who want it can blank-import the feature package, and
tsnet's dep test now locks that in.

Updates #12614

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I3f1d09f9dc03e18f9a648ab5e42d16fa540b3fa9
2026-07-14 20:22:23 -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 feature/captiveportal: move captive portal code out of ipnlocal, netcheck 2026-07-14 20:22:23 -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