Manage status for TCP element in the endpoint overview.

This commit is contained in:
Ludovic Fernandez 2019-07-18 15:56:04 +02:00 committed by Traefiker Bot
parent 75aedc8e94
commit 68c349bbfa
6 changed files with 108 additions and 11 deletions

View file

@ -52,6 +52,7 @@ func TestHandler_TCP(t *testing.T) {
Passthrough: false,
},
},
Status: runtime.StatusEnabled,
},
"bar@myprovider": {
TCPRouter: &dynamic.TCPRouter{
@ -59,6 +60,15 @@ func TestHandler_TCP(t *testing.T) {
Service: "foo-service@myprovider",
Rule: "Host(`foo.bar`)",
},
Status: runtime.StatusWarning,
},
"foo@myprovider": {
TCPRouter: &dynamic.TCPRouter{
EntryPoints: []string{"web"},
Service: "foo-service@myprovider",
Rule: "Host(`foo.bar`)",
},
Status: runtime.StatusDisabled,
},
},
},
@ -173,6 +183,7 @@ func TestHandler_TCP(t *testing.T) {
},
},
UsedBy: []string{"foo@myprovider", "test@myprovider"},
Status: runtime.StatusEnabled,
},
"baz@myprovider": {
TCPService: &dynamic.TCPService{
@ -185,6 +196,20 @@ func TestHandler_TCP(t *testing.T) {
},
},
UsedBy: []string{"foo@myprovider"},
Status: runtime.StatusWarning,
},
"foz@myprovider": {
TCPService: &dynamic.TCPService{
LoadBalancer: &dynamic.TCPLoadBalancerService{
Servers: []dynamic.TCPServer{
{
Address: "127.0.0.2:2345",
},
},
},
},
UsedBy: []string{"foo@myprovider"},
Status: runtime.StatusDisabled,
},
},
},