mirror of
https://github.com/containous/traefik.git
synced 2025-03-19 18:50:12 +03:00
feat(consul-catalog-provider): + setting unique backend name + backend redirecting to internal container ip
This commit is contained in:
parent
9a407f79ff
commit
4f044cf2f9
@ -63,6 +63,7 @@ func TestConsulCatalogBuildConfig(t *testing.T) {
|
||||
{
|
||||
Service: &api.AgentService{
|
||||
Service: "test",
|
||||
Address: "127.0.0.1",
|
||||
Port: 80,
|
||||
},
|
||||
Node: &api.Node{
|
||||
@ -86,7 +87,7 @@ func TestConsulCatalogBuildConfig(t *testing.T) {
|
||||
expectedBackends: map[string]*types.Backend{
|
||||
"backend-test": {
|
||||
Servers: map[string]types.Server{
|
||||
"server-localhost-80": {
|
||||
"test--127-0-0-1--80": {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
[backends]{{range .Nodes}}
|
||||
[backends.backend-{{getBackend .}}.servers.server-{{.Node.Node | replace "." "-"}}-{{.Service.Port}}]
|
||||
url = "http://{{.Node.Address}}:{{.Service.Port}}"
|
||||
[backends.backend-{{getBackend .}}.servers.{{.Service.Service | replace "." "-"}}--{{.Service.Address | replace "." "-"}}--{{.Service.Port}}]
|
||||
url = "http://{{.Service.Address}}:{{.Service.Port}}"
|
||||
{{end}}
|
||||
|
||||
[frontends]{{range .Services}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user