Skip to content

chore: remove dead code surfaced by the improvement sweep - #614

Merged
bpalermo merged 1 commit into
mainfrom
chore/dead-code
Aug 1, 2026
Merged

bpalermo merged 1 commit into
mainfrom
chore/dead-code

Conversation

@bpalermo

@bpalermo bpalermo commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Dead-code cohort. Every deletion was verified two ways: golang.org/x/tools/cmd/deadcode across all 7 main packages (including agent/cmd/mesh-dns and prober — omitting them produces ~70 false hits), then grep for zero non-test references. Deletion-only; −146 lines, no behavior change.

what why it died
attachment.firstBackendPort / firstBackendNamespace edge Phase 1 leftovers; live selection logic is in the projector
gamma backendServiceKey / backendPermitted (+ serviceref import) duplicates of the live copies in common/gammaproject and l4route
proxy.EdgeGatewayListener struct superseded by discrete params (proposal 021)
proxy.UDPServiceRoute parked UDP data plane uses map[string][]L4Backend
waypointTunnelChainName (+ test symmetry line) name is built inline as "ew_" + fqdn
cni checkValidCNIConfig istio-derived stub whose whole body is return nil
cni ctStateEstablishedRelated local const mask is hardcoded two lines below
constants.DefaultEtcdKeyPrefix unreferenced and misleading — real default is /aether/v1/regions in registry/internal/etcd
telemetry.AttrNodeName/AttrClusterName/AttrServiceName never emitted anywhere (the other 4 keys in the block are live)
spire.Bridge.NodeSpiffeID getter zero callers; the underlying field stays (read internally for first-serve detection)
agent --mesh-dns-upstream flag + Config.MeshDNSUpstream + doc row orphaned by the #578 mesh-DNS decouple; the daemon registers its own flag

Flag-removal note: the chart only passes --mesh-dns-upstream to the mesh-dns container (agent-daemonset.yaml mentions it in a comment only), so in-repo deployment is unaffected. Cobra hard-errors on unknown flags, so any out-of-tree agent manifest still passing it would crash-loop at startup — flagging since it's technically user-visible.

Deliberately NOT deleted (test-only, judgment calls — say the word and they go too):

  • proxy.ToConfigProjection + 2 helpers — the export half is production-dead (registrar's configexport builds protos directly); only a round-trip test uses it. Deleting means deleting projection_test.go's round-trip too.
  • attachment.firstBackendService — same family as the two deleted here, but it has dedicated tests.
  • config.Http1ProtocolOptions, meshdns.NewServer, ddb.WithTableName, storage.MockStorage, registry/registrytest — legit test seams / symmetric API; keep.

Zero whole files or packages were deletable — the tree is clean after all the refactor waves.

Testing

  • bazel run //:gazelle (dropped the stale gamma→serviceref BUILD dep) + bazel run //:format
  • bazel test --test_output=errors //... — 79/79 pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

Verified via golang.org/x/tools/cmd/deadcode across all 7 main packages
plus grep cross-checks (zero non-test references for every item):

- attachment: firstBackendPort, firstBackendNamespace (edge Phase 1
  leftovers; the live selection logic is in the projector)
- gamma reconciler: backendServiceKey, backendPermitted (duplicates of
  the live copies in common/gammaproject and l4route) + serviceref import
- proxy: EdgeGatewayListener struct (superseded by discrete params,
  021), UDPServiceRoute (parked UDP data plane uses the map form),
  waypointTunnelChainName (name is built inline; drop the test's
  symmetry line)
- cni: checkValidCNIConfig (istio-derived stub returning nil),
  function-local ctStateEstablishedRelated const (mask is hardcoded)
- constants: DefaultEtcdKeyPrefix (stale AND misleading — the real
  default is registry/internal/etcd DefaultKeyPrefix "/aether/v1/regions")
- telemetry: AttrNodeName/AttrClusterName/AttrServiceName (never emitted)
- spire: Bridge.NodeSpiffeID getter (field stays; it is read internally)
- agent --mesh-dns-upstream flag + Config.MeshDNSUpstream + doc row:
  orphaned by the mesh-DNS decouple (#578) — the daemon registers its
  own flag; the chart only passes it to the mesh-dns container

Deletion-only (no behavior change); make gazelle dropped the stale
gamma->serviceref BUILD dep.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
@bpalermo
bpalermo merged commit c1eeaa5 into main Aug 1, 2026
15 checks passed
@bpalermo
bpalermo deleted the chore/dead-code branch August 1, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant