refactor(marathon): rewrite configuration system.
This commit is contained in:
parent
ae2ae85070
commit
cee022b935
9 changed files with 649 additions and 1319 deletions
|
@ -4,11 +4,11 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/containous/traefik/provider/label"
|
||||
"github.com/gambol99/go-marathon"
|
||||
)
|
||||
|
||||
const testTaskName string = "taskID"
|
||||
const testTaskName = "taskID"
|
||||
|
||||
// Functions related to building applications.
|
||||
|
||||
|
@ -38,7 +38,7 @@ func appPorts(ports ...int) func(*marathon.Application) {
|
|||
}
|
||||
}
|
||||
|
||||
func label(key, value string) func(*marathon.Application) {
|
||||
func withLabel(key, value string) func(*marathon.Application) {
|
||||
return func(app *marathon.Application) {
|
||||
app.AddLabel(key, value)
|
||||
}
|
||||
|
@ -55,9 +55,9 @@ func labelWithService(key, value string, serviceName string) func(*marathon.Appl
|
|||
panic("serviceName can not be empty")
|
||||
}
|
||||
|
||||
property := strings.TrimPrefix(key, types.LabelPrefix)
|
||||
property := strings.TrimPrefix(key, label.Prefix)
|
||||
return func(app *marathon.Application) {
|
||||
app.AddLabel(types.LabelPrefix+serviceName+"."+property, value)
|
||||
app.AddLabel(label.Prefix+serviceName+"."+property, value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue