Skip to content

Fix Docker IPv6 route discovery for IPAM networks - #575

Merged
itzg merged 2 commits into
mainfrom
itzg-container-with-ipam-config-is-not-discov
Jul 19, 2026
Merged

Fix Docker IPv6 route discovery for IPAM networks#575
itzg merged 2 commits into
mainfrom
itzg-container-with-ipam-config-is-not-discov

Conversation

@itzg

@itzg itzg commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Docker-discovered routes were skipped when a container only exposed an IPv6 address, because discovery only read endpoint.IPAddress (IPv4). This broke discoverability for IPv6-only and IPAM-assigned IPv6 container setups.

This change updates Docker parsing to prefer IPv4 when present and fall back to GlobalIPv6Address when IPv4 is empty. It also switches Docker backend endpoint construction to net.JoinHostPort so IPv6 backends are always formatted correctly as [addr]:port.

Tests

  • Added server/docker_test.go with coverage for:
    • IPv4 precedence when both addresses exist
    • IPv6 fallback when IPv4 is absent
    • IPv6 selection on an explicitly labeled network
    • rejection when no routable address is available
    • IPv6 endpoint formatting via backend host:port generation
  • Ran go test ./server -count=1

Fixes: #574

itzg and others added 2 commits July 19, 2026 15:39
Prefer IPv4 and fall back to GlobalIPv6Address when parsing Docker endpoint settings so IPv6-only/IPAM-assigned containers are routable.

Also normalize Docker backend endpoint construction with net.JoinHostPort to produce valid host:port strings for IPv6.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@itzg
itzg merged commit 0b42963 into main Jul 19, 2026
1 of 2 checks passed
@itzg
itzg deleted the itzg-container-with-ipam-config-is-not-discov branch July 19, 2026 21:14
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.

Container with IPv6 address is not discoverable

1 participant