feat: add ipv4/ipv6 dual stack support
What type of PR is this?
feat: add ipv4/ipv6 dual stack support
What this PR does / why we need it: This PR adds IPv4/IPv6 dual stack support to Envoy Gateway. It implements test cases for routing to IPv6-only, dual-stack, and IPv4-only services using HTTPRoute resources. This enhancement is crucial for supporting modern network environments and ensuring compatibility with both IPv4 and IPv6 infrastructures.
Key changes include:
- New test file
backend_dualstack.gofor testing IPv6 and dual-stack backends - New test file
httproute_dualstack.gofor testing HTTPRoute support with various IP versions - New manifest files for defining resources used in dual-stack tests
- Implementation of
getDnsLookupFamilyfunction to control DNS lookup behavior
Which issue(s) this PR fixes:
Fixes #184
Additional Notes:
- Tests are skipped in IPv4-only environments (
IP_FAMILY=ipv4) - All tests run in IPv6 or dual-stack environments (
IP_FAMILY=ipv6orIP_FAMILY=dual)
hey @juwon8891 we probably also need to add some logic in https://github.com/envoyproxy/gateway/blob/4b8c2f56dc45534c42b6513b126082f49a009658/internal/gatewayapi/route.go#L1328 which selects specific endpoints based on the ipFamilyPolicy field
Codecov Report
Attention: Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.
Project coverage is 65.80%. Comparing base (
7188dad) to head (faa584b).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| internal/gatewayapi/helpers.go | 36.36% | 7 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #4375 +/- ##
==========================================
+ Coverage 65.78% 65.80% +0.02%
==========================================
Files 210 210
Lines 31516 31557 +41
==========================================
+ Hits 20732 20766 +34
- Misses 9588 9594 +6
- Partials 1196 1197 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
hey @juwon8891 lint is failing
internal/xds/translator/testdata/in/xds-ir/tcp-listener-ipfamily.yaml
Error: 7:5 [indentation] wrong indentation: expected 6 but found 4
Error: 11:9 [indentation] wrong indentation: expected 10 but found 8
Error: 12:11 [indentation] wrong indentation: expected 12 but found 10
Error: 13:32 [new-line-at-end-of-file] no new line character at the end of file
hey @juwon8891 looks like some gateway api tests got wiped out, can you add them back ?
@juwon8891 Do you have time to address the comments this week? We want to ensure dual stack support is ready to be included in the coming v1.2.
Yes, I'm working on it. I'll answer as soon as possible
hey @juwon8891, added some minor comments, but overall LGTM !
@juwon8891 please run make gen-check to pass the gen-check CI.
@juwon8891 DCO is failing, can you sign your commits
/retest