Expected Behavior
Endpoint fields parsed by pkg/url.ParseEndpoint should accept valid URL host:port forms, including bracketed IPv6 literals such as https://[fd00::1]:443.
Current Behavior
ParseEndpoint currently splits url.Host with strings.Split(url.Host, ":"). For bracketed IPv6 hosts this produces more than two parts, so valid endpoints such as https://[fd00::1]:443 are rejected as invalid host.
This affects callers that validate or render endpoint fields through ParseEndpoint, including LogCollector additional store endpoints and NonClusterHost endpoints.
Possible Solution
Use the standard library host/port helpers for URL host parsing, so bracketed IPv6 literals are handled correctly while malformed host:port values still fail validation.
Steps to Reproduce (for bugs)
- Call
pkg/url.ParseEndpoint("https://[fd00::1]:443").
- Observe that it returns an
invalid host error.
- The endpoint is a valid URL host:port value and should parse to scheme
https, host fd00::1, and port 443.
Context
IPv6 endpoint literals are valid URL hosts when bracketed. Rejecting them prevents users from configuring IPv6 endpoints in resources that rely on this parser.
Your Environment
- Operating System and version: N/A
- Link to your project (optional): N/A
Expected Behavior
Endpoint fields parsed by
pkg/url.ParseEndpointshould accept valid URL host:port forms, including bracketed IPv6 literals such ashttps://[fd00::1]:443.Current Behavior
ParseEndpointcurrently splitsurl.Hostwithstrings.Split(url.Host, ":"). For bracketed IPv6 hosts this produces more than two parts, so valid endpoints such ashttps://[fd00::1]:443are rejected asinvalid host.This affects callers that validate or render endpoint fields through
ParseEndpoint, including LogCollector additional store endpoints and NonClusterHost endpoints.Possible Solution
Use the standard library host/port helpers for URL host parsing, so bracketed IPv6 literals are handled correctly while malformed host:port values still fail validation.
Steps to Reproduce (for bugs)
pkg/url.ParseEndpoint("https://[fd00::1]:443").invalid hosterror.https, hostfd00::1, and port443.Context
IPv6 endpoint literals are valid URL hosts when bracketed. Rejecting them prevents users from configuring IPv6 endpoints in resources that rely on this parser.
Your Environment