BUG/MINOR: e2e: build host-port addresses with net.JoinHostPort - #838
Merged
Conversation
MaxRink
force-pushed
the
fix/ipv6-host-port-e2e
branch
from
August 28, 2026 01:14
46bb06e to
ed8c8ac
Compare
oktalz
force-pushed
the
fix/ipv6-host-port-e2e
branch
from
September 2, 2026 12:30
ed8c8ac to
a4bc2ab
Compare
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
force-pushed
the
fix/ipv6-host-port-e2e
branch
from
September 2, 2026 12:43
a4bc2ab to
1b465df
Compare
Member
|
thx @MaxRink ! |
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.
go vet ./...reports on unmodified master:CI does not run
go vet, so the defect survived.Changes
deploy/tests/e2e/client.gobuilds three addresses fromKIND_URLwithfmt.Sprintf("%s:%d", ...), at lines 84, 156 and 200. An IPv6 literal inKIND_URLyields an unparsable address, soDialContext,ResolveTCPAddrandDialfail.net.JoinHostPortbrackets the literal. Only line 200 is visible togo vet, the other two are the same defect.pkg/gateways/gateways.gobuilds theserversByBackendchange-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.ymladdsgo vet ./...to thelinttask, which thelintersCI job runs.go vetis clean across the tree after this change, with and without the e2e build tags, so it adds no noise.Not changed:
main.go:229and:232formatIPV4BindAddr, which is IPv4 by definition and only logged.pkg/utils/logging.goandpkg/haproxy/instance/configuration.goformatfile:line, not host-port.Verification
go vet ./...,go build ./..., revive v1.13.0 withrevive.toml, staticcheck v0.6.1 and gofumpt are all clean.go test ./pkg/... ./test/...passes.go vetandgo buildwith the e2e build tags are clean.