mirror of
https://github.com/traefik/traefik.git
synced 2025-09-27 08:41:16 +02:00
Merge v1.2.3 master
This commit is contained in:
parent
8ac281f9e3
commit
4e186cecf9
@ -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…
x
Reference in New Issue
Block a user