Repository navigation
e2e: add dual-stack (IPv4+IPv6) backend test matrix - #2536
Merged
Merged
Conversation
Extend the kind-based e2e suite with a dual-stack matrix that exercises flannel IPv6 alongside IPv4 for the IPv6-capable backends (vxlan, vxlan-nftables, wireguard, host-gw). - Generate the kind config in code so IP_FAMILY=dual toggles a dual-stack cluster (ipFamily: dual + dual podSubnet). - Inject IPv6Network/EnableIPv6 into net-conf.json when dual-stack. - Add IPv6 pod-to-pod ping and golden ip6tables / nft ip6 flannel-ipv6 rule assertions mirroring the trafficmngr source. - Skip the IPv4-only matrix when IP_FAMILY=dual (its v4 checks are covered by the dual-stack specs) to keep runtime bounded. - CI: add an ip-family [ipv4, dual] matrix; the dual leg enables IPv6 in the Docker daemon before creating the cluster. All flannel IPv6 traffic stays inside the kind Docker network, so the runner needs no routable IPv6 connectivity. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
rbrtbnfgl
approved these changes
Aug 13, 2026
There was a problem hiding this comment.
Pull request overview
This PR extends flannel’s kind-based end-to-end test suite (e2e/) to exercise dual-stack (IPv4+IPv6) behavior across the IPv6-capable backends, and wires that dual-stack leg into GitHub Actions so the IPv6 datapath is covered in CI.
Changes:
- Add an
IP_FAMILY=dualdual-stack matrix that validates both IPv4 and IPv6 pod-to-pod connectivity for selected backends. - Generate kind cluster config in code to toggle
ipFamily: dualand dual pod subnets, and inject IPv6 settings intonet-conf.jsonwhen dual-stack is enabled. - Add IPv6 rule assertions for both ip6tables and nftables, plus helper functions to discover/ping IPv6 pod/node CIDRs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Passes IP_FAMILY into the kind e2e test invocation so the suite can toggle dual-stack mode. |
| e2e/rules.go | Adds IPv6 golden-rule builders and checks for ip6tables/nftables, and factors common rule construction helpers. |
| e2e/kube.go | Adds helpers to retrieve IPv6 PodCIDR/PodIP and an IPv6 ping poll helper. |
| e2e/kind-config.yaml | Documents that kind config is now generated in code and keeps the YAML as an IPv4 reference for manual runs. |
| e2e/flannel.go | Extends manifest rendering/installation to inject IPv6Network and EnableIPv6 into net-conf.json when dual-stack. |
| e2e/e2e_suite_test.go | Plumbs FLANNEL_IPV6_NET and IP_FAMILY into suite-wide configuration and logs dual-stack mode. |
| e2e/connectivity_test.go | Adds a dual-stack backend matrix and skips the IPv4-only matrix when running in dual-stack mode. |
| e2e/cluster.go | Generates kind cluster YAML in code (including dual-stack toggling) and uses CreateWithRawConfig. |
| .github/workflows/kind-e2eTests.yml | Adds an ip-family: [ipv4, dual] matrix and enables Docker IPv6 for the dual-stack leg. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the kind-based e2e suite (
e2e/) with a dual-stack (IPv4+IPv6) test matrix, increasing coverage of flannel's IPv6 path which was previously untested end-to-end.The dual-stack matrix runs the IPv6-capable backends —
vxlan,vxlan-nftables,wireguard,host-gw— and asserts both IPv4 and IPv6 pod-to-pod connectivity plus the golden masquerade/forward rules for both families.How
kindConfigYAMLincluster.go, viaCreateWithRawConfig):IP_FAMILY=dualproducesipFamily: dual+ a dualpodSubnet. The statickind-config.yamlis kept as an IPv4 reference for running kind manually.installFlannel/renderFlannelManifestinjectIPv6Network+EnableIPv6when dual-stack.connectivity_test.go): aflannel dual-stack backendsDescribe that pings over v4 and v6 and checks v4+v6 rules. The IPv4-only matrix is skipped whenIP_FAMILY=dual(its IPv4 assertions are covered by the dual-stack specs) to keep runtime bounded.rules.go):ip6tablesandnft ip6 flannel-ipv6postrouting/forward assertions mirrored from thetrafficmngrsource (ff00::/8multicast,ip6 saddr/daddr).kube.go):podCIDRv6,podIPv6,waitForPing6.CI
kind-e2eTests.ymlnow uses anip-family: [ipv4, dual]matrix. Thedualleg enables IPv6 in the Docker daemon (ipv6+fixed-cidr-v6+ip6tablesindaemon.json, plusip6table_nat/ip6table_filter) before creating the cluster.Why this works on GitHub-hosted runners: all flannel IPv6 traffic stays inside the kind Docker network (node containers on a Docker bridge), so the runner does not need routable/internet IPv6 connectivity — only the Docker daemon's internal IPv6 enabled. This is dual-stack (not v6-only), since the control plane and image pulls still use IPv4.
Validation
gofmtclean;go vet -tags e2e ./...passes.Notes / risk
I could not run the full kind suite locally (needs Docker + kind + IPv6), so the golden IPv6 rule strings are derived from flannel's source rather than observed output. The IPv6
FORWARD-chain assertion assumes kube-proxy programsip6tablesidentically to IPv4 — the same assumption the existing IPv4 test already makes. The first CI run on thedualleg is the real validation and may surface a minor rule-text tweak.