Update Kubernetes provider to support IPv6 Backends

This commit is contained in:
Daniel Tomcej 2018-06-05 02:28:03 -06:00 committed by Traefiker Bot
parent ae7c947ba5
commit 1d84bda7ca

View file

@ -6,6 +6,7 @@ import (
"errors"
"flag"
"fmt"
"net"
"os"
"reflect"
"strconv"
@ -302,7 +303,7 @@ func (p *Provider) loadIngresses(k8sClient Client) (*types.Configuration, error)
for _, subset := range endpoints.Subsets {
for _, address := range subset.Addresses {
url := protocol + "://" + address.IP + ":" + strconv.Itoa(endpointPortNumber(port, subset.Ports))
url := protocol + "://" + net.JoinHostPort(address.IP, strconv.Itoa(endpointPortNumber(port, subset.Ports)))
name := url
if address.TargetRef != nil && address.TargetRef.Name != "" {
name = address.TargetRef.Name