Marathon constraints filtering

This commit is contained in:
Alex Antonov 2017-11-21 03:48:04 -06:00 committed by Traefiker
parent 7ddefcef72
commit 4b91204686
4 changed files with 65 additions and 20 deletions

View file

@ -44,6 +44,12 @@ func label(key, value string) func(*marathon.Application) {
}
}
func constraint(value string) func(*marathon.Application) {
return func(app *marathon.Application) {
app.AddConstraint(strings.Split(value, ":")...)
}
}
func labelWithService(key, value string, serviceName string) func(*marathon.Application) {
if len(serviceName) == 0 {
panic("serviceName can not be empty")