Add TCP Servers Transports support
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
c2dac39da1
commit
3eeea2bb2b
101 changed files with 5956 additions and 1669 deletions
|
@ -41,7 +41,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
var updateExpected = flag.Bool("update_expected", false, "Update expected files in fixtures")
|
||||
var updateExpected = flag.Bool("update_expected", true, "Update expected files in fixtures")
|
||||
|
||||
var fullDynConf *dynamic.Configuration
|
||||
|
||||
|
@ -370,7 +370,6 @@ func init() {
|
|||
Services: map[string]*dynamic.TCPService{
|
||||
"foo": {
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
TerminationDelay: intPtr(42),
|
||||
ProxyProtocol: &dynamic.ProxyProtocol{
|
||||
Version: 42,
|
||||
},
|
||||
|
@ -379,6 +378,7 @@ func init() {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
ServersTransport: "foo",
|
||||
},
|
||||
},
|
||||
"bar": {
|
||||
|
@ -392,6 +392,24 @@ func init() {
|
|||
},
|
||||
},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.TCPServersTransport{
|
||||
"foo": {
|
||||
TLS: &dynamic.TLSClientConfig{
|
||||
ServerName: "foo",
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"rootca.pem"},
|
||||
Certificates: []traefiktls.Certificate{
|
||||
{
|
||||
CertFile: "cert.pem",
|
||||
KeyFile: "key.pem",
|
||||
},
|
||||
},
|
||||
},
|
||||
DialTimeout: 42,
|
||||
DialKeepAlive: 42,
|
||||
TerminationDelay: 42,
|
||||
},
|
||||
},
|
||||
}
|
||||
config.UDP = &dynamic.UDPConfiguration{
|
||||
Routers: map[string]*dynamic.UDPRouter{
|
||||
|
@ -500,17 +518,6 @@ func TestDo_staticConfiguration(t *testing.T) {
|
|||
SendAnonymousUsage: true,
|
||||
}
|
||||
|
||||
config.ServersTransport = &static.ServersTransport{
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"root.ca"},
|
||||
MaxIdleConnsPerHost: 42,
|
||||
ForwardingTimeouts: &static.ForwardingTimeouts{
|
||||
DialTimeout: 42,
|
||||
ResponseHeaderTimeout: 42,
|
||||
IdleConnTimeout: 42,
|
||||
},
|
||||
}
|
||||
|
||||
config.EntryPoints = static.EntryPoints{
|
||||
"foobar": {
|
||||
Address: "foo Address",
|
||||
|
@ -569,6 +576,15 @@ func TestDo_staticConfiguration(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
config.TCPServersTransport = &static.TCPServersTransport{
|
||||
DialTimeout: ptypes.Duration(111 * time.Second),
|
||||
DialKeepAlive: ptypes.Duration(111 * time.Second),
|
||||
TLS: &static.TLSClientConfig{
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
},
|
||||
}
|
||||
|
||||
config.Providers.File = &file.Provider{
|
||||
Directory: "file Directory",
|
||||
Watch: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue