Commit Graph
2 Commits
Author SHA1 Message Date
chaosinthecrd 57ca6e1e2a cmd/k8s-operator/e2e: test that cleanup finds devices by machine key
Adds an e2e test for proxy cleanup when the state Secret has no
device_id, as the unit tests use a fake client and can't show that
control honours the machineKey filter. It fills the tailnet with other
devices, checks the filter returns only the proxy's device, then removes
device_id from the state Secret and unexposes the Service. It checks
that the proxy's device is deleted and the other devices are left alone.

Updates #18922

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-02 11:36:55 +00:00
chaosinthecrd 06e3480a85 cmd/k8s-operator: clean up HA Service when proxy-group annotation removed
When the tailscale.com/proxy-group annotation is removed from a Service
that was exposed on a ProxyGroup, the HA Service reconciler returned early
on the empty annotation before reaching its cleanup path. The Tailscale
Service was left advertised and the operator's finalizer was never removed,
so the Tailscale Service leaked and the Kubernetes Service wedged forever in
Terminating once deleted.

The annotation is the only place the ProxyGroup name was recorded, and it is
gone by the time cleanup needs it. This commit encodes the ProxyGroup name in
the finalizer, which survives any modification of the resources annotations.
On reconcile, an empty annotation with our finalizer present now recovers the
ProxyGroup name from the finalizer and runs cleanup. Services carrying the bare
legacy finalizer are migrated to the encoded form while the annotation is still
present.

Updates #19922

Signed-off-by: chaosinthecrd <[email protected]>
2026-09-29 14:55:00 +01:00