Support multi-port service routing for containers running on Marathon
This commit is contained in:
parent
0367034f93
commit
ec3e2c08b8
9 changed files with 498 additions and 134 deletions
|
@ -1,8 +1,10 @@
|
|||
package marathon
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/gambol99/go-marathon"
|
||||
)
|
||||
|
||||
|
@ -42,6 +44,17 @@ func label(key, value string) func(*marathon.Application) {
|
|||
}
|
||||
}
|
||||
|
||||
func labelWithService(key, value string, serviceName string) func(*marathon.Application) {
|
||||
if len(serviceName) == 0 {
|
||||
panic("serviceName can not be empty")
|
||||
}
|
||||
|
||||
property := strings.TrimPrefix(key, types.LabelPrefix)
|
||||
return func(app *marathon.Application) {
|
||||
app.AddLabel(types.LabelPrefix+serviceName+"."+property, value)
|
||||
}
|
||||
}
|
||||
|
||||
func healthChecks(checks ...*marathon.HealthCheck) func(*marathon.Application) {
|
||||
return func(app *marathon.Application) {
|
||||
for _, check := range checks {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue