1
0
Fork 0

Use net.JoinHostPort for servers URL

This commit is contained in:
Ludovic Fernandez 2018-06-13 10:08:03 +02:00 committed by Traefiker Bot
parent 2e95832812
commit b59276ff1c
5 changed files with 10 additions and 5 deletions

View file

@ -3,6 +3,7 @@ package mesos
import (
"fmt"
"math"
"net"
"strconv"
"strings"
"text/template"
@ -185,7 +186,7 @@ func (p *Provider) getServers(tasks []taskData) map[string]types.Server {
serverName := "server-" + getID(task)
servers[serverName] = types.Server{
URL: fmt.Sprintf("%s://%s:%s", protocol, host, port),
URL: fmt.Sprintf("%s://%s", protocol, net.JoinHostPort(host, port)),
Weight: getIntValue(task.TraefikLabels, label.TraefikWeight, label.DefaultWeight, math.MaxInt32),
}
}