Add entrypoints to providers

This commit is contained in:
emile 2016-02-01 16:08:58 +01:00
parent 81cb00573f
commit a8cc26fd91
No known key found for this signature in database
GPG key ID: D808B4C167352E59
10 changed files with 63 additions and 19 deletions

View file

@ -4,6 +4,7 @@ import (
"errors"
"net/url"
"strconv"
"strings"
"text/template"
"github.com/BurntSushi/ty/fun"
@ -86,6 +87,7 @@ func (provider *Marathon) loadMarathonConfig() *types.Configuration {
"getDomain": provider.getDomain,
"getProtocol": provider.getProtocol,
"getPassHostHeader": provider.getPassHostHeader,
"getEntryPoints": provider.getEntryPoints,
"getFrontendValue": provider.getFrontendValue,
"getFrontendRule": provider.getFrontendRule,
"replace": replace,
@ -286,6 +288,13 @@ func (provider *Marathon) getPassHostHeader(application marathon.Application) st
return "false"
}
func (provider *Marathon) getEntryPoints(application marathon.Application) []string {
if entryPoints, err := provider.getLabel(application, "traefik.frontend.entryPoints"); err == nil {
return strings.Split(entryPoints, ",")
}
return []string{}
}
// getFrontendValue returns the frontend value for the specified application, using
// it's label. It returns a default one if the label is not present.
func (provider *Marathon) getFrontendValue(application marathon.Application) string {