From d82325edf7ca386b96e7e2458891114939281654 Mon Sep 17 00:00:00 2001 From: Zhipeng Liu Date: Sat, 29 Feb 2020 01:51:36 +0800 Subject: [PATCH] Fix ipv6 address cannot be parsed in mariadb-ingress pod There is a bug in nginx.tmpl that it will not enclose ipv6 addresses in square brackets resulting in them being unable to be parsed. Test pass on both ipv4 and ipv6 simplex setup for StarlingX project Change-Id: I16e586f5d8e3dfcb5e94f0486409c9637ba197b2 Signed-off-by: Zhipeng Liu --- mariadb/files/nginx.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mariadb/files/nginx.tmpl b/mariadb/files/nginx.tmpl index 5ec3d0db6..356fad502 100644 --- a/mariadb/files/nginx.tmpl +++ b/mariadb/files/nginx.tmpl @@ -473,11 +473,11 @@ stream { {{ range $j, $endpoint := $tcpServer.Endpoints }} {{ if eq $j 0 }} # NOTE(portdirect): see https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-health-check/#passive-tcp-health-checks to tune passive healthchecks - server {{ $endpoint.Address }}:{{ $endpoint.Port }}; + server {{ formatIP $endpoint.Address }}:{{ $endpoint.Port }}; {{ else if eq $j 1 }} - server {{ $endpoint.Address }}:{{ $endpoint.Port }} backup; + server {{ formatIP $endpoint.Address }}:{{ $endpoint.Port }} backup; {{ else }} - server {{ $endpoint.Address }}:{{ $endpoint.Port }} down; + server {{ formatIP $endpoint.Address }}:{{ $endpoint.Port }} down; {{ end }} {{ end }} }