Merge v1.2.3 master
This commit is contained in:
parent
8ac281f9e3
commit
4e186cecf9
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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{
|
||||||
|
|
Loading…
Reference in a new issue