Use net.JoinHostPort to handle address format.
Signed-off-by: Dong Chen <dongluo.chen@docker.com> Upstream-commit: 7554e882dfe3a3eb9ec61457e20a42de528db725 Component: engine
This commit is contained in:
@@ -89,7 +89,7 @@ func ParseAdvertise(advertise string) (string, error) {
|
||||
return "", fmt.Errorf("couldnt find a valid ip-address in interface %s", advertise)
|
||||
}
|
||||
|
||||
addr = fmt.Sprintf("%s:%s", addr, port)
|
||||
addr = net.JoinHostPort(addr, port)
|
||||
return addr, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user