Skip to content

Handle IPv6 endpoints in URL parser#4750

Open
officialasishkumar wants to merge 1 commit intotigera:masterfrom
officialasishkumar:fix-parse-endpoint-ipv6
Open

Handle IPv6 endpoints in URL parser#4750
officialasishkumar wants to merge 1 commit intotigera:masterfrom
officialasishkumar:fix-parse-endpoint-ipv6

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Description

Bug fix for endpoint parsing in pkg/url.ParseEndpoint.

The parser previously split url.Host on every :, which rejected valid bracketed IPv6 URL endpoints such as https://[fd00::1]:443. This updates the parser to use the standard library host/port parser so DNS names, IPv4 hosts, and bracketed IPv6 hosts are handled consistently while malformed endpoints still fail validation.

Fixes #4749

Validation run:

  • go test ./pkg/url
  • go test ./pkg/controller/logcollector ./pkg/controller/nonclusterhost ./pkg/controller/manager
  • go test ./pkg/render

go test ./pkg/render/... was also attempted, but pkg/render/istio requires base.tgz, which is not present in a fresh clone.

Release Note

Parse endpoint validation now accepts bracketed IPv6 URL endpoints.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParseEndpoint rejects bracketed IPv6 endpoint URLs

2 participants