Skip to content

BUG/MINOR: e2e: build host-port addresses with net.JoinHostPort - #838

Merged
oktalz merged 1 commit into
haproxytech:masterfrom
MaxRink:fix/ipv6-host-port-e2e
Sep 2, 2026
Merged

BUG/MINOR: e2e: build host-port addresses with net.JoinHostPort#838
oktalz merged 1 commit into
haproxytech:masterfrom
MaxRink:fix/ipv6-host-port-e2e

Conversation

@MaxRink

@MaxRink MaxRink commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

go vet ./... reports on unmodified master:

deploy/tests/e2e/client.go:200:43: address format "%s:%d" does not work with IPv6

CI does not run go vet, so the defect survived.

Changes

deploy/tests/e2e/client.go builds three addresses from KIND_URL with fmt.Sprintf("%s:%d", ...), at lines 84, 156 and 200. An IPv6 literal in KIND_URL yields an unparsable address, so DialContext, ResolveTCPAddr and Dial fail. net.JoinHostPort brackets the literal. Only line 200 is visible to go vet, the other two are the same defect.

pkg/gateways/gateways.go builds the serversByBackend change-detection key with the same format. With IPv6 the key is ambiguous, so a real endpoint change can escape the reload comparison. Same fix.

taskfile.yml adds go vet ./... to the lint task, which the linters CI job runs. go vet is clean across the tree after this change, with and without the e2e build tags, so it adds no noise.

Not changed: main.go:229 and :232 format IPV4BindAddr, which is IPv4 by definition and only logged. pkg/utils/logging.go and pkg/haproxy/instance/configuration.go format file:line, not host-port.

Verification

go vet ./..., go build ./..., revive v1.13.0 with revive.toml, staticcheck v0.6.1 and gofumpt are all clean. go test ./pkg/... ./test/... passes. go vet and go build with the e2e build tags are clean.

@oktalz oktalz added the enhancement New feature or request label Aug 26, 2026
@MaxRink
MaxRink force-pushed the fix/ipv6-host-port-e2e branch from 46bb06e to ed8c8ac Compare August 28, 2026 01:14
@oktalz
oktalz force-pushed the fix/ipv6-host-port-e2e branch from ed8c8ac to a4bc2ab Compare September 2, 2026 12:30
The dial and resolve helpers formatted the address with "%s:%d". An IPv6
literal in KIND_URL produces an unparsable address, so the connection
fails. net.JoinHostPort brackets the literal.

The gateway server key used the same format. Two endpoints that differ
only in the IPv6 part can render the same key, so a change escapes the
reload detection.

go vet reports the dial site on master. The lint task now runs go vet,
which is clean across the tree.
@oktalz
oktalz force-pushed the fix/ipv6-host-port-e2e branch from a4bc2ab to 1b465df Compare September 2, 2026 12:43
@oktalz
oktalz merged commit 98ed57d into haproxytech:master Sep 2, 2026
8 checks passed
@oktalz

oktalz commented Sep 2, 2026

Copy link
Copy Markdown
Member

thx @MaxRink !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants