Merge pull request #18 from thorhs/marathon_get_prefixes
Add getPrefixes to get string array of PathPrefixes
This commit is contained in:
commit
ce1d14d779
3 changed files with 36 additions and 0 deletions
|
@ -54,6 +54,14 @@ var MarathonFuncMap = template.FuncMap{
|
|||
}
|
||||
return "0"
|
||||
},
|
||||
"getPrefixes": func(application marathon.Application) ([]string, error) {
|
||||
for key, value := range application.Labels {
|
||||
if key == "traefik.prefixes" {
|
||||
return strings.Split(value, ","), nil
|
||||
}
|
||||
}
|
||||
return []string{}, nil
|
||||
},
|
||||
"replace": func(s1 string, s2 string, s3 string) string {
|
||||
return strings.Replace(s3, s1, s2, -1)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue