1
0
Fork 0

Use first port by default

If no information is given, use first index of ports
This commit is contained in:
Guilhem Lettron 2016-10-27 15:49:34 +02:00
parent 1c8d3ded3d
commit 5641af437e
2 changed files with 5 additions and 8 deletions

View file

@ -219,10 +219,7 @@ func (provider *Marathon) taskFilter(task marathon.Task, applications *marathon.
log.Debugf("Filtering marathon task %s specifying both traefik.portIndex and traefik.port labels", task.AppID)
return false
}
if portIndexLabel == "" && portValueLabel == "" && len(application.Ports) > 1 {
log.Debugf("Filtering marathon task %s with more than 1 port and no traefik.portIndex or traefik.port label", task.AppID)
return false
}
if portIndexLabel != "" {
index, err := strconv.Atoi((*application.Labels)["traefik.portIndex"])
if err != nil || index < 0 || index > len(application.Ports)-1 {