Merge v1.2.3 master

This commit is contained in:
Emile Vauge 2017-05-03 23:24:53 +02:00
parent 8ac281f9e3
commit 4e186cecf9
No known key found for this signature in database
GPG key ID: D808B4C167352E59
2 changed files with 4 additions and 1 deletions

View file

@ -542,6 +542,9 @@ func (p *Provider) getFrontendRule(container dockerData) string {
if label, err := getLabel(container, "traefik.frontend.rule"); err == nil { if label, err := getLabel(container, "traefik.frontend.rule"); err == nil {
return label return label
} }
if labels, err := getLabels(container, []string{"com.docker.compose.project", "com.docker.compose.service"}); err == nil {
return "Host:" + p.getSubDomain(labels["com.docker.compose.service"]+"."+labels["com.docker.compose.project"]) + "." + p.Domain
}
if len(p.Domain) > 0 { if len(p.Domain) > 0 {
return "Host:" + p.getSubDomain(container.ServiceName) + "." + p.Domain return "Host:" + p.getSubDomain(container.ServiceName) + "." + p.Domain
} }

View file

@ -133,7 +133,7 @@ func TestDockerGetServiceFrontendRule(t *testing.T) {
}{ }{
{ {
container: containerJSON(name("foo")), container: containerJSON(name("foo")),
expected: "Host:foo.", expected: "",
}, },
{ {
container: containerJSON(labels(map[string]string{ container: containerJSON(labels(map[string]string{