Add marathon label to configure basic auth, similar to docker and rancher providers
This commit is contained in:
parent
c31b4c55c2
commit
4dfbb6d489
4 changed files with 62 additions and 5 deletions
|
@ -163,6 +163,7 @@ func (p *Provider) loadMarathonConfig() *types.Configuration {
|
|||
"hasHealthCheckLabels": p.hasHealthCheckLabels,
|
||||
"getHealthCheckPath": p.getHealthCheckPath,
|
||||
"getHealthCheckInterval": p.getHealthCheckInterval,
|
||||
"getBasicAuth": p.getBasicAuth,
|
||||
}
|
||||
|
||||
applications, err := p.marathonClient.Applications(nil)
|
||||
|
@ -485,6 +486,14 @@ func (p *Provider) getHealthCheckInterval(application marathon.Application) stri
|
|||
return ""
|
||||
}
|
||||
|
||||
func (p *Provider) getBasicAuth(application marathon.Application) []string {
|
||||
if basicAuth, ok := p.getLabel(application, "traefik.frontend.auth.basic"); ok {
|
||||
return strings.Split(basicAuth, ",")
|
||||
}
|
||||
|
||||
return []string{}
|
||||
}
|
||||
|
||||
func processPorts(application marathon.Application, task marathon.Task) (int, error) {
|
||||
if portLabel, ok := (*application.Labels)[labelPort]; ok {
|
||||
port, err := strconv.Atoi(portLabel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue