tailscale/cmd/k8s-operator
Brad Fitzpatrick bdcb71a0d0 tsnet: make workload identity federation opt-in
The tailscale.com/wif package brings in the AWS SDK
(github.com/aws/aws-sdk-go-v2/{config,sts,...} and github.com/aws/smithy-go)
to support fetching ID tokens from AWS IMDS for workload identity
federation. Until now, tsnet pulled this in unconditionally via
feature/condregister/identityfederation, costing ~70 unwanted deps for
every tsnet program whether or not it uses workload identity federation.

These AWS SDK deps were originally removed from tsnet on 2025-09-29 by
commit 69c79cb9f ("ipn/store, feature/condregister: move AWS + Kube
store registration to condregister"). They were then accidentally added
back on 2026-01-14 by commit 6a6aa805d ("cmd,feature: add identity
token auto generation for workload identity", PR #18373) when the new
wif package was wired into tsnet via feature/identityfederation.

Drop the blanket import. tsnet programs that want workload identity
federation now opt in with:

    import _ "tailscale.com/feature/identityfederation"

The hook lookup in resolveAuthKey already uses GetOk and degrades
gracefully when the feature isn't linked, so existing programs that
don't use workload identity federation see no behavior change. The
tailscale CLI still imports the condregister wrapper directly, so its
behavior is also unchanged.

Lock this in with TestDeps additions: tailscale.com/wif as a BadDep,
plus substring checks in OnDep that fail on any github.com/aws/ or
k8s.io/ dependency creeping back in.

Also, switch cmd/gitops-pusher from the condregister wrapper to a
direct import of feature/identityfederation: gitops-pusher's auth flow
calls HookExchangeJWTForTokenViaWIF directly, so it shouldn't be
subject to the ts_omit_identityfederation build tag.

Updates #12614

Change-Id: I70599f2bdd4d3666b26a859d5b76caa5d6b94507
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit 87a74c3aa2)
2026-05-07 08:24:14 -07:00
..
deploy cmd/k8s-operator: add nodeSelector to DNSConfig resource (#19429) 2026-04-29 15:56:33 +01: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: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +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/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
connector.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
depaware.txt tsnet: make workload identity federation opt-in 2026-05-07 08:24:14 -07:00
dnsrecords_test.go types/ptr: deprecate ptr.To, use Go 1.26 new 2026-03-05 20:13:18 -08:00
dnsrecords.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
egress-eps_test.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
egress-eps.go cmd/{containerboot,k8s-operator}: don't return pointers to maps (#19593) 2026-04-30 16:11:00 +01:00
egress-pod-readiness_test.go types/ptr: deprecate ptr.To, use Go 1.26 new 2026-03-05 20:13:18 -08:00
egress-pod-readiness.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
egress-services_test.go cmd/{containerboot,k8s-operator}: don't return pointers to maps (#19593) 2026-04-30 16:11:00 +01:00
egress-services-readiness_test.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
egress-services-readiness.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
egress-services.go cmd/{containerboot,k8s-operator}: don't return pointers to maps (#19593) 2026-04-30 16:11:00 +01:00
ingress_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01: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: truncate long label values in metrics resources (#18895) 2026-04-28 14:11:59 +01:00
ingress.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
logger.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
metrics_resources.go cmd/k8s-operator: truncate long label values in metrics resources (#18895) 2026-04-28 14:11:59 +01: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: add authkey reissuing to recorder reconciler (#19556) 2026-05-01 18:26:55 +01:00
proxyclass_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
proxyclass.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
proxygroup_specs.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
proxygroup_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
proxygroup.go cmd/k8s-operator: add authkey reissuing to recorder reconciler (#19556) 2026-05-01 18:26:55 +01:00
sts_test.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
sts.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +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: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
svc-for-pg.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
svc.go cmd/k8s-operator: fix Service reconcile triggers for default ProxyClass (#18983) 2026-03-13 14:31:16 +00:00
testutils_test.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +01:00
tsclient.go cmd/k8s-operator: migrate to tailscale-client-go-v2 (#19010) 2026-04-09 14:39:46 +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