From c71abce0b871831a43a4d5301cb85aa341cd85b2 Mon Sep 17 00:00:00 2001 From: santoshpulluri Date: Tue, 28 Apr 2026 07:53:46 +0000 Subject: [PATCH] backport of commit fa7de2245c6a9a1bf045d53d1ca3b50f749991d1 --- .changelog/1066.txt | 2 ++ pkg/envoy/proxy.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changelog/1066.txt diff --git a/.changelog/1066.txt b/.changelog/1066.txt new file mode 100644 index 00000000..3437d357 --- /dev/null +++ b/.changelog/1066.txt @@ -0,0 +1,2 @@ +```release-note:bug +- envoy: use safe host:port construction for remaining admin API URLs to avoid malformed admin endpoint URLs with IPv6 addresses \ No newline at end of file diff --git a/pkg/envoy/proxy.go b/pkg/envoy/proxy.go index 213e52ce..07c14bc5 100644 --- a/pkg/envoy/proxy.go +++ b/pkg/envoy/proxy.go @@ -279,7 +279,10 @@ func (p *Proxy) DumpConfig() error { } func (p *Proxy) dumpConfig() error { - envoyConfigDumpUrl := fmt.Sprintf("http://%s:%v/config_dump?include_eds", p.cfg.AdminAddr, p.cfg.AdminBindPort) + envoyConfigDumpUrl := fmt.Sprintf( + "http://%s/config_dump?include_eds", + net.JoinHostPort(p.cfg.AdminAddr, strconv.Itoa(p.cfg.AdminBindPort)), + ) rsp, err := p.client.Get(envoyConfigDumpUrl) if err != nil { @@ -390,7 +393,10 @@ func (p *Proxy) Ready() (bool, error) { return false, nil case stateRunning, stateInitial: // Query ready endpoint to check if proxy is Ready - envoyReadyURL := fmt.Sprintf("http://%s:%v/ready", p.cfg.AdminAddr, p.cfg.AdminBindPort) + envoyReadyURL := fmt.Sprintf( + "http://%s/ready", + net.JoinHostPort(p.cfg.AdminAddr, strconv.Itoa(p.cfg.AdminBindPort)), + ) rsp, err := p.client.Get(envoyReadyURL) if err != nil { p.cfg.Logger.Error("envoy: admin endpoint not available", "error", err)