From 3ac8d4e7a61281d9dcb6b23afe992df53831f730 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Mon, 12 Jul 2021 09:04:54 -0500 Subject: [PATCH] consul/connect: use join host port Co-authored-by: Michael Schurter --- client/allocrunner/taskrunner/envoy_bootstrap_hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/allocrunner/taskrunner/envoy_bootstrap_hook.go b/client/allocrunner/taskrunner/envoy_bootstrap_hook.go index 3aaf2d2e0..41f604500 100644 --- a/client/allocrunner/taskrunner/envoy_bootstrap_hook.go +++ b/client/allocrunner/taskrunner/envoy_bootstrap_hook.go @@ -381,7 +381,7 @@ func buildEnvoyBind(alloc *structs.Allocation, ifce, service, task string, taskE } } } - return fmt.Sprintf("%s:%d", ifce, port) + return net.JoinHostPort(ifce, strconv.Itoa(port)) } func (h *envoyBootstrapHook) writeConfig(filename, config string) error {