Skip to content

Support IngressRouteTCP resources#238

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-ingressroutetcp-support
Draft

Support IngressRouteTCP resources#238
Copilot wants to merge 4 commits intomainfrom
copilot/add-ingressroutetcp-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Adds IngressRouteTCP reconciliation so Switchboard triggers external-dns and cert-manager for TCP ingress resources, mirroring existing IngressRoute behavior.

Changes

  • Host extraction (internal/switchboard/hosts.go): Added WithTLSTCPHostsIfAvailable and WithRouteTCPHostsIfRequired methods. TCP routes use HostSNI() matchers (parsed via muxer/tcp.ParseHostSNI) instead of Host(). Wildcard HostSNI(*) entries are filtered out.
  • Generalized reconciler (internal/controllers/ingressroute.go): Introduced an ingressAdapter interface with two implementations (ingressRouteAdapter and ingressRouteTCPAdapter). The existing IngressRouteReconciler is now generalized to handle both IngressRoute and IngressRouteTCP resources — reconciliation logic is fully shared, with only resource creation, info extraction, and watch setup delegated to the adapter.
  • Generic builder (internal/controllers/utils.go): Made builderWithIntegrations generic over client.ObjectList so both adapters can share watch/own setup logic.
  • Registration (cmd/main.go): TCP controller registered alongside the existing one via NewIngressRouteTCPReconciler.
  • RBAC (chart/templates/rbac.yaml): Added ingressroutetcps to the ClusterRole.
  • Dev setup (pixi.toml): Added IngressRouteTCP CRD to cluster bootstrap.

Example

An IngressRouteTCP like:

apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
  name: my-tcp-ingress
spec:
  routes:
    - match: "HostSNI(`db.example.com`)"
  tls:
    secretName: db-tls-certificate

will now produce a Certificate and DNSEndpoint resource, same as IngressRoute does today.

Copilot AI changed the title [WIP] Add support for IngressRouteTCP resources Support IngressRouteTCP resources Apr 13, 2026
Copilot AI requested a review from borchero April 13, 2026 20:02
@github-actions
Copy link
Copy Markdown

Thank you for opening this pull request! 👋🏼

This repository requires pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details
No release type found in pull request title "Support IngressRouteTCP resources". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@borchero
Copy link
Copy Markdown
Owner

@copilot the existing ingressroute.go class should be abstracted/generalized to also deal with the ingressroutetcp resource

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 47.72727% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.40%. Comparing base (5cc6f69) to head (e5113ee).

Files with missing lines Patch % Lines
internal/controllers/ingressroutetcp.go 45.28% 23 Missing and 6 partials ⚠️
cmd/main.go 0.00% 7 Missing ⚠️
internal/controllers/ingressroute.go 0.00% 6 Missing ⚠️
internal/controllers/utils.go 0.00% 2 Missing ⚠️
internal/switchboard/hosts.go 90.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
- Coverage   57.51%   56.40%   -1.12%     
==========================================
  Files          16       17       +1     
  Lines         419      500      +81     
==========================================
+ Hits          241      282      +41     
- Misses        159      192      +33     
- Partials       19       26       +7     
Files with missing lines Coverage Δ
internal/controllers/utils.go 65.78% <0.00%> (+4.81%) ⬆️
internal/switchboard/hosts.go 91.30% <90.00%> (-1.29%) ⬇️
internal/controllers/ingressroute.go 45.28% <0.00%> (-4.72%) ⬇️
cmd/main.go 0.00% <0.00%> (ø)
internal/controllers/ingressroutetcp.go 45.28% <45.28%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cc6f69...e5113ee. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI and others added 2 commits April 13, 2026 20:15
… IngressRoute and IngressRouteTCP

Agent-Logs-Url: https://github.com/borchero/switchboard/sessions/cec72c49-62ec-435f-909c-31f9d1647cc8

Co-authored-by: borchero <22455425+borchero@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 13, 2026

@copilot the existing ingressroute.go class should be abstracted/generalized to also deal with the ingressroutetcp resource

Refactored in 361a1cd. The IngressRouteReconciler now uses an ingressAdapter interface with two implementations (ingressRouteAdapter and ingressRouteTCPAdapter). The reconciliation logic is fully shared — only resource creation, info extraction, and watch setup are type-specific. The separate ingressroutetcp.go file has been removed.

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.

[Feature Request] Support for IngressRouteTCP resources

2 participants