chore: update linter
This commit is contained in:
parent
9c50129520
commit
f437fb4230
38 changed files with 796 additions and 830 deletions
|
@ -67,8 +67,8 @@ type ProviderAggregator struct {
|
|||
}
|
||||
|
||||
// NewProviderAggregator returns an aggregate of all the providers configured in the static configuration.
|
||||
func NewProviderAggregator(conf static.Providers) ProviderAggregator {
|
||||
p := ProviderAggregator{
|
||||
func NewProviderAggregator(conf static.Providers) *ProviderAggregator {
|
||||
p := &ProviderAggregator{
|
||||
providersThrottleDuration: time.Duration(conf.ProvidersThrottleDuration),
|
||||
}
|
||||
|
||||
|
@ -172,12 +172,12 @@ func (p *ProviderAggregator) AddProvider(provider provider.Provider) error {
|
|||
}
|
||||
|
||||
// Init the provider.
|
||||
func (p ProviderAggregator) Init() error {
|
||||
func (p *ProviderAggregator) Init() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Provide calls the provide method of every providers.
|
||||
func (p ProviderAggregator) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error {
|
||||
func (p *ProviderAggregator) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error {
|
||||
if p.fileProvider != nil {
|
||||
p.launchProvider(configurationChan, pool, p.fileProvider)
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ func (p ProviderAggregator) Provide(configurationChan chan<- dynamic.Message, po
|
|||
return nil
|
||||
}
|
||||
|
||||
func (p ProviderAggregator) launchProvider(configurationChan chan<- dynamic.Message, pool *safe.Pool, prd provider.Provider) {
|
||||
func (p *ProviderAggregator) launchProvider(configurationChan chan<- dynamic.Message, pool *safe.Pool, prd provider.Provider) {
|
||||
jsonConf, err := redactor.RemoveCredentials(prd)
|
||||
if err != nil {
|
||||
log.WithoutContext().Debugf("Cannot marshal the provider configuration %T: %v", prd, err)
|
||||
|
|
|
@ -13,8 +13,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func TestDefaultRule(t *testing.T) {
|
||||
testCases := []struct {
|
||||
|
@ -64,7 +63,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -118,7 +117,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -164,7 +163,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -210,7 +209,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -262,7 +261,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -350,7 +349,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -407,7 +406,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "https://127.0.0.1:443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "tls-ns-dc1-dev-Test",
|
||||
},
|
||||
},
|
||||
|
@ -497,7 +496,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "https://127.0.0.2:444",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "tls-ns-dc1-dev-Test",
|
||||
},
|
||||
},
|
||||
|
@ -578,7 +577,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -588,7 +587,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -651,7 +650,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -711,7 +710,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -774,7 +773,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -826,7 +825,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -879,7 +878,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -924,7 +923,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -982,7 +981,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1030,7 +1029,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -1040,7 +1039,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1216,7 +1215,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1267,7 +1266,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1344,7 +1343,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1408,7 +1407,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1488,7 +1487,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1548,7 +1547,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1622,7 +1621,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1688,7 +1687,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1740,7 +1739,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1793,7 +1792,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "h2c://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1840,7 +1839,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -1850,7 +1849,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2074,7 +2073,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2137,7 +2136,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2188,7 +2187,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2241,7 +2240,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2337,7 +2336,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2393,7 +2392,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2515,7 +2514,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2544,7 +2543,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2631,7 +2630,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2668,7 +2667,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2760,7 +2759,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2844,7 +2843,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "https://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "tls-ns-dc1-Test",
|
||||
},
|
||||
},
|
||||
|
@ -2855,7 +2854,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "https://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "tls-ns-dc1-Test",
|
||||
},
|
||||
},
|
||||
|
@ -2933,7 +2932,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Servers: []dynamic.TCPServer{
|
||||
{Address: "127.0.0.1:80"},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
"Test-17573747155436217342": {
|
||||
|
@ -2941,7 +2940,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Servers: []dynamic.TCPServer{
|
||||
{Address: "127.0.0.2:80"},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3136,7 +3135,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -307,7 +307,7 @@ func (p *Provider) getIPPort(ctx context.Context, container dockerData, serverPo
|
|||
return ip, port, nil
|
||||
}
|
||||
|
||||
func (p Provider) getIPAddress(ctx context.Context, container dockerData) string {
|
||||
func (p *Provider) getIPAddress(ctx context.Context, container dockerData) string {
|
||||
logger := log.FromContext(ctx)
|
||||
|
||||
netNotFound := false
|
||||
|
|
|
@ -71,7 +71,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -130,7 +130,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -191,7 +191,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -244,7 +244,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -297,7 +297,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -356,7 +356,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -579,7 +579,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -658,7 +658,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -668,7 +668,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -747,7 +747,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -807,7 +807,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -868,7 +868,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -921,7 +921,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -987,7 +987,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1043,7 +1043,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -1053,7 +1053,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1113,7 +1113,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1353,7 +1353,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1412,7 +1412,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1508,7 +1508,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1591,7 +1591,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1696,7 +1696,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1773,7 +1773,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1872,7 +1872,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1954,7 +1954,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2026,7 +2026,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -2036,7 +2036,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2096,7 +2096,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2157,7 +2157,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "h2c://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2212,7 +2212,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -2222,7 +2222,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2418,7 +2418,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"Test": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2487,7 +2487,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Services: map[string]*dynamic.TCPService{
|
||||
"Test": {
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2676,7 +2676,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2747,7 +2747,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2806,7 +2806,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2867,7 +2867,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2979,7 +2979,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3043,7 +3043,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3215,7 +3215,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3314,7 +3314,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3391,7 +3391,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://192.168.0.1:8081",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3451,7 +3451,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:79",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3958,6 +3958,4 @@ func TestSwarmGetPort(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
|
|
@ -12,8 +12,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func TestDefaultRule(t *testing.T) {
|
||||
testCases := []struct {
|
||||
|
@ -66,7 +65,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://10.0.0.1:1337",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -120,7 +119,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -176,7 +175,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -224,7 +223,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -272,7 +271,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -326,7 +325,7 @@ func TestDefaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -528,7 +527,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -597,7 +596,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -607,7 +606,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -676,7 +675,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -731,7 +730,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -787,7 +786,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -835,7 +834,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -896,7 +895,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -947,7 +946,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -957,7 +956,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1012,7 +1011,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1217,7 +1216,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1271,7 +1270,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1357,7 +1356,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1430,7 +1429,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1520,7 +1519,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1587,7 +1586,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1671,7 +1670,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1744,7 +1743,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1806,7 +1805,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -1816,7 +1815,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1871,7 +1870,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1927,7 +1926,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "h2c://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1983,7 +1982,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "h2c://127.0.0.1:8040",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2047,7 +2046,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:32124",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -2057,7 +2056,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:32123",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2107,7 +2106,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -2117,7 +2116,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2397,7 +2396,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2463,7 +2462,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2517,7 +2516,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2573,7 +2572,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2675,7 +2674,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2734,7 +2733,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2891,7 +2890,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2980,7 +2979,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3046,7 +3045,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -321,7 +321,7 @@ func (c configBuilder) buildServersLB(namespace string, svc traefikv1alpha1.Load
|
|||
return &dynamic.Service{LoadBalancer: lb}, nil
|
||||
}
|
||||
|
||||
func (c *configBuilder) makeServersTransportKey(parentNamespace string, serversTransportName string) (string, error) {
|
||||
func (c configBuilder) makeServersTransportKey(parentNamespace string, serversTransportName string) (string, error) {
|
||||
if serversTransportName == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ import (
|
|||
|
||||
var _ provider.Provider = (*Provider)(nil)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func TestLoadIngressRouteTCPs(t *testing.T) {
|
||||
testCases := []struct {
|
||||
|
@ -376,11 +375,11 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
Services: []dynamic.TCPWRRService{
|
||||
{
|
||||
Name: "default-test.route-fdd3e9338e47a45efefc-whoamitcp-8000",
|
||||
Weight: func(i int) *int { return &i }(2),
|
||||
Weight: pointer(2),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-fdd3e9338e47a45efefc-whoamitcp2-8080",
|
||||
Weight: func(i int) *int { return &i }(3),
|
||||
Weight: pointer(3),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -443,15 +442,15 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
Services: []dynamic.TCPWRRService{
|
||||
{
|
||||
Name: "default-test.route-fdd3e9338e47a45efefc-whoamitcp-8000",
|
||||
Weight: func(i int) *int { return &i }(2),
|
||||
Weight: pointer(2),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-fdd3e9338e47a45efefc-whoamitcp2-8080",
|
||||
Weight: func(i int) *int { return &i }(3),
|
||||
Weight: pointer(3),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-fdd3e9338e47a45efefc-whoamitcp3-8083",
|
||||
Weight: func(i int) *int { return &i }(4),
|
||||
Weight: pointer(4),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1054,7 +1053,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
Address: "10.10.0.2:8000",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(500),
|
||||
TerminationDelay: pointer(500),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1264,11 +1263,11 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
Services: []dynamic.TCPWRRService{
|
||||
{
|
||||
Name: "default-test.route-673acf455cb2dab0b43a-whoamitcp-ipv6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-673acf455cb2dab0b43a-external.service.with.ipv6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1313,7 +1312,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
URL: "http://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: func(i bool) *bool { return &i }(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-external-svc-with-ipv6-8080": {
|
||||
|
@ -1323,7 +1322,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
URL: "http://[2001:db8:85a3:8d3:1319:8a2e:370:7347]:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: func(i bool) *bool { return &i }(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-route-6b204d94623b3df4370c": {
|
||||
|
@ -1331,11 +1330,11 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami-ipv6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-external-svc-with-ipv6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1537,7 +1536,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1605,7 +1604,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1656,7 +1655,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1713,7 +1712,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1761,7 +1760,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-route-77c62dfe9517144aeeaa": {
|
||||
|
@ -1774,7 +1773,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1813,11 +1812,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami2-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1832,7 +1831,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami2-8080": {
|
||||
|
@ -1845,7 +1844,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1883,7 +1882,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1898,7 +1897,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1929,7 +1928,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1944,7 +1943,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1982,11 +1981,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-wrr1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-wrr2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1996,11 +1995,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami4-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2015,7 +2014,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami5-8080": {
|
||||
|
@ -2028,7 +2027,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-wrr2": {
|
||||
|
@ -2036,11 +2035,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami6-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami7-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2055,7 +2054,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.6:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami7-8080": {
|
||||
|
@ -2068,7 +2067,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.8:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2106,11 +2105,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-wrr2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2120,7 +2119,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2135,7 +2134,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2173,15 +2172,15 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-wrr2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-mirror1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2191,7 +2190,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2214,7 +2213,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami5-8080": {
|
||||
|
@ -2227,7 +2226,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2266,23 +2265,23 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "baz-whoami6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "foo-wrr1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "foo-mirror2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "foo-mirror3",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "foo-mirror4",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2297,7 +2296,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.6:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"foo-wrr1": {
|
||||
|
@ -2305,19 +2304,19 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "foo-whoami4-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "baz-whoami6-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "foo-mirror1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "bar-wrr2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2332,7 +2331,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"foo-mirror1": {
|
||||
|
@ -2355,7 +2354,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"bar-mirrored": {
|
||||
|
@ -2393,7 +2392,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "foo-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2457,7 +2456,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami5-8080": {
|
||||
|
@ -2470,7 +2469,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2516,7 +2515,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami4-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2526,7 +2525,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami5-8080",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2541,7 +2540,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami5-8080": {
|
||||
|
@ -2554,7 +2553,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2592,11 +2591,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami-80",
|
||||
Weight: Int(10),
|
||||
Weight: pointer(10),
|
||||
},
|
||||
{
|
||||
Name: "default-whoami2-8080",
|
||||
Weight: Int(0),
|
||||
Weight: pointer(0),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2611,7 +2610,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-whoami2-8080": {
|
||||
|
@ -2624,7 +2623,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2744,7 +2743,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2813,7 +2812,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2861,7 +2860,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2930,7 +2929,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3000,7 +2999,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3068,7 +3067,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3140,7 +3139,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3213,7 +3212,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3257,7 +3256,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3300,7 +3299,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "https://10.10.0.6:8443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3343,7 +3342,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "https://10.10.0.8:8443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3590,7 +3589,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3632,7 +3631,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(false),
|
||||
PassHostHeader: pointer(false),
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{FlushInterval: "10s"},
|
||||
},
|
||||
},
|
||||
|
@ -3687,7 +3686,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3744,7 +3743,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3790,7 +3789,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3831,7 +3830,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://external.domain:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3870,7 +3869,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://external.domain:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3909,7 +3908,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "https://external.domain:443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4000,7 +3999,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "https://external.domain:443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "default-test",
|
||||
},
|
||||
},
|
||||
|
@ -4014,7 +4013,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "https://10.10.0.6:8443",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "default-default-test",
|
||||
},
|
||||
},
|
||||
|
@ -4023,11 +4022,11 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-external-svc-with-https-443",
|
||||
Weight: Int(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-whoamitls-443",
|
||||
Weight: Int(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4086,7 +4085,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"default-test-route-6b204d94623b3df4370c": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4130,7 +4129,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4176,18 +4175,18 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-test-weighted",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-test-mirror",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"default-test-errorpage-errorpage-service": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-weighted": {
|
||||
|
@ -4195,7 +4194,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "default-whoami-without-endpoints-subsets-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4215,7 +4214,7 @@ func TestLoadIngressRoutes(t *testing.T) {
|
|||
},
|
||||
"default-whoami-without-endpoints-subsets-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4390,11 +4389,11 @@ func TestLoadIngressRouteUDPs(t *testing.T) {
|
|||
Services: []dynamic.UDPWRRService{
|
||||
{
|
||||
Name: "default-test.route-0-whoamiudp-8000",
|
||||
Weight: func(i int) *int { return &i }(2),
|
||||
Weight: pointer(2),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-0-whoamiudp2-8080",
|
||||
Weight: func(i int) *int { return &i }(3),
|
||||
Weight: pointer(3),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -4456,15 +4455,15 @@ func TestLoadIngressRouteUDPs(t *testing.T) {
|
|||
Services: []dynamic.UDPWRRService{
|
||||
{
|
||||
Name: "default-test.route-0-whoamiudp-8000",
|
||||
Weight: func(i int) *int { return &i }(2),
|
||||
Weight: pointer(2),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-0-whoamiudp2-8080",
|
||||
Weight: func(i int) *int { return &i }(3),
|
||||
Weight: pointer(3),
|
||||
},
|
||||
{
|
||||
Name: "default-test.route-0-whoamiudp3-8083",
|
||||
Weight: func(i int) *int { return &i }(4),
|
||||
Weight: pointer(4),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5096,7 +5095,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5171,7 +5170,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-crossnamespace-route-9313b71dbe6a649d5049": {
|
||||
|
@ -5184,7 +5183,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-errorpage-errorpage-service": {
|
||||
|
@ -5197,7 +5196,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-test-crossnamespace-route-a1963878aac7331b7950": {
|
||||
|
@ -5210,7 +5209,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5254,23 +5253,23 @@ func TestCrossNamespace(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "cross-ns-whoami-svc-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-tr-svc-wrr1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "cross-ns-tr-svc-wrr2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "default-tr-svc-mirror1",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
{
|
||||
Name: "cross-ns-tr-svc-mirror2",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5285,7 +5284,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "foo-test@kubernetescrd",
|
||||
},
|
||||
},
|
||||
|
@ -5299,7 +5298,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"default-tr-svc-wrr1": {
|
||||
|
@ -5307,7 +5306,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "cross-ns-whoami-svc-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5317,7 +5316,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "cross-ns-whoami-svc-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5354,7 +5353,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5385,7 +5384,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "cross-ns-whoami-svc-80",
|
||||
Weight: func(i int) *int { return &i }(1),
|
||||
Weight: pointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5400,7 +5399,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"cross-ns-tr-svc-mirror2": {
|
||||
|
@ -5424,7 +5423,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5468,7 +5467,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ServersTransport: "cross-ns-st-cross-ns@kubernetescrd",
|
||||
},
|
||||
},
|
||||
|
@ -5560,7 +5559,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -5619,7 +5618,7 @@ func TestCrossNamespace(t *testing.T) {
|
|||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -6167,7 +6166,7 @@ func TestExternalNameService(t *testing.T) {
|
|||
URL: "http://external.domain:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -6454,7 +6453,7 @@ func TestNativeLB(t *testing.T) {
|
|||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -124,7 +124,7 @@ func Test_parseServiceConfig(t *testing.T) {
|
|||
},
|
||||
ServersScheme: "protocol",
|
||||
ServersTransport: "foobar@file",
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
NativeLB: true,
|
||||
},
|
||||
},
|
||||
|
@ -137,7 +137,7 @@ func Test_parseServiceConfig(t *testing.T) {
|
|||
expected: &ServiceConfig{
|
||||
Service: &ServiceIng{
|
||||
Sticky: &dynamic.Sticky{Cookie: &dynamic.Cookie{}},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
|
||||
var _ provider.Provider = (*Provider)(nil)
|
||||
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
testCases := []struct {
|
||||
|
@ -68,7 +68,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -115,7 +115,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Sticky: &dynamic.Sticky{
|
||||
Cookie: &dynamic.Cookie{
|
||||
Name: "foobar",
|
||||
|
@ -157,7 +157,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -191,7 +191,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -225,7 +225,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -259,7 +259,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -289,7 +289,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -319,7 +319,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-example-com-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:80",
|
||||
|
@ -350,7 +350,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -384,7 +384,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -418,7 +418,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -431,7 +431,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
},
|
||||
"testing-service2-8082": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.2:8080",
|
||||
|
@ -462,7 +462,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -496,7 +496,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"default-backend": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -526,7 +526,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -556,7 +556,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -586,7 +586,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -620,7 +620,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -633,7 +633,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
},
|
||||
"testing-service1-carotte": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8090",
|
||||
|
@ -663,7 +663,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -697,7 +697,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
|
@ -710,7 +710,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
},
|
||||
"toto-service1-tchouk": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:8089",
|
||||
|
@ -762,7 +762,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-8080": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.0.0.1:8080",
|
||||
|
@ -790,7 +790,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-example-com-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:80",
|
||||
|
@ -827,7 +827,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-443": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:8443",
|
||||
|
@ -857,7 +857,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-8443": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:8443",
|
||||
|
@ -888,7 +888,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-8443": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:8443",
|
||||
|
@ -919,7 +919,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"default-backend": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.30.0.1:8080",
|
||||
|
@ -949,7 +949,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1023,7 +1023,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1053,7 +1053,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1085,7 +1085,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1113,7 +1113,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1141,7 +1141,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1169,7 +1169,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1197,7 +1197,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1225,7 +1225,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1265,7 +1265,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1294,7 +1294,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1322,7 +1322,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1350,7 +1350,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1378,7 +1378,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1406,7 +1406,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1434,7 +1434,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1462,7 +1462,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1490,7 +1490,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1518,7 +1518,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-80": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1546,7 +1546,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-foobar": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:4711",
|
||||
|
@ -1587,7 +1587,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"default-backend": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
|
@ -1676,7 +1676,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-8080": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://traefik.wtf:8080",
|
||||
|
@ -1708,7 +1708,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
|
|||
URL: "http://[2001:0db8:3c4d:0015:0000:0000:1a2f:1a2b]:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1736,7 +1736,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
|
|||
URL: "http://[2001:0db8:3c4d:0015:0000:0000:1a2f:2a3b]:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1809,7 +1809,7 @@ func TestLoadConfigurationFromIngressesWithNativeLB(t *testing.T) {
|
|||
Services: map[string]*dynamic.Service{
|
||||
"testing-service1-8080": {
|
||||
LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://10.0.0.1:8080",
|
||||
|
|
|
@ -15,6 +15,8 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func Test_buildConfiguration(t *testing.T) {
|
||||
provider := newProviderMock(mapToPairs(map[string]string{
|
||||
"traefik/http/routers/Router0/entryPoints/0": "foobar",
|
||||
|
@ -647,13 +649,13 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Interval: "foobar",
|
||||
Timeout: "foobar",
|
||||
Hostname: "foobar",
|
||||
FollowRedirects: func(v bool) *bool { return &v }(true),
|
||||
FollowRedirects: pointer(true),
|
||||
Headers: map[string]string{
|
||||
"name0": "foobar",
|
||||
"name1": "foobar",
|
||||
},
|
||||
},
|
||||
PassHostHeader: func(v bool) *bool { return &v }(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foobar",
|
||||
},
|
||||
|
@ -662,7 +664,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
"Service02": {
|
||||
Mirroring: &dynamic.Mirroring{
|
||||
Service: "foobar",
|
||||
MaxBodySize: func(v int64) *int64 { return &v }(42),
|
||||
MaxBodySize: pointer[int64](42),
|
||||
Mirrors: []dynamic.MirrorService{
|
||||
{
|
||||
Name: "foobar",
|
||||
|
@ -680,11 +682,11 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "foobar",
|
||||
Weight: func(v int) *int { return &v }(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
{
|
||||
Name: "foobar",
|
||||
Weight: func(v int) *int { return &v }(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
},
|
||||
Sticky: &dynamic.Sticky{
|
||||
|
@ -768,7 +770,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Services: map[string]*dynamic.TCPService{
|
||||
"TCPService01": {
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
TerminationDelay: func(v int) *int { return &v }(42),
|
||||
TerminationDelay: pointer(42),
|
||||
Servers: []dynamic.TCPServer{
|
||||
{Address: "foobar"},
|
||||
{Address: "foobar"},
|
||||
|
@ -780,11 +782,11 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Services: []dynamic.TCPWRRService{
|
||||
{
|
||||
Name: "foobar",
|
||||
Weight: func(v int) *int { return &v }(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
{
|
||||
Name: "foobar",
|
||||
Weight: func(v int) *int { return &v }(43),
|
||||
Weight: pointer(43),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -13,8 +13,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func TestGetConfigurationAPIErrors(t *testing.T) {
|
||||
fakeClient := newFakeClient(true, marathon.Applications{})
|
||||
|
@ -73,7 +72,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -146,7 +145,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -202,7 +201,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -248,7 +247,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -314,7 +313,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8081",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -378,7 +377,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8083",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -431,7 +430,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
"bar": {LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
Servers: []dynamic.Server{
|
||||
|
@ -439,7 +438,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8081",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -487,7 +486,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:81",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -533,7 +532,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
@ -580,7 +579,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -620,7 +619,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -673,7 +672,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -716,7 +715,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -726,7 +725,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -837,7 +836,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -847,7 +846,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -905,7 +904,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -915,7 +914,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -962,7 +961,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -972,7 +971,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1026,7 +1025,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1073,7 +1072,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -1083,7 +1082,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1130,7 +1129,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1178,7 +1177,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "h2c://localhost:90",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1220,7 +1219,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -1230,7 +1229,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1459,7 +1458,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1507,7 +1506,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1554,7 +1553,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1593,7 +1592,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1679,7 +1678,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1728,7 +1727,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1824,7 +1823,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1874,7 +1873,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Address: "localhost:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1900,7 +1899,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1964,7 +1963,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2012,7 +2011,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
}},
|
||||
},
|
||||
ServersTransports: map[string]*dynamic.ServersTransport{},
|
||||
|
|
|
@ -58,7 +58,7 @@ func Test_defaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -112,7 +112,7 @@ func Test_defaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -157,7 +157,7 @@ func Test_defaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -208,7 +208,7 @@ func Test_defaultRule(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -282,7 +282,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -345,7 +345,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://192.168.1.101:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -355,7 +355,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://192.168.1.102:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -418,7 +418,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -478,7 +478,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -541,7 +541,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -593,7 +593,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -646,7 +646,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -691,7 +691,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -749,7 +749,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -797,7 +797,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -807,7 +807,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -984,7 +984,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1035,7 +1035,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1113,7 +1113,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1178,7 +1178,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1237,7 +1237,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1301,7 +1301,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1353,7 +1353,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1406,7 +1406,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "h2c://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1453,7 +1453,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -1463,7 +1463,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1654,7 +1654,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1717,7 +1717,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1768,7 +1768,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1821,7 +1821,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1917,7 +1917,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1973,7 +1973,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2095,7 +2095,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2124,7 +2124,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2211,7 +2211,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2248,7 +2248,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2340,7 +2340,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2423,7 +2423,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test-1234154071633021619": {
|
||||
|
@ -2433,7 +2433,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2497,7 +2497,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Servers: []dynamic.TCPServer{
|
||||
{Address: "127.0.0.1:80"},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
"Test-8769860286750522282": {
|
||||
|
@ -2505,7 +2505,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
Servers: []dynamic.TCPServer{
|
||||
{Address: "127.0.0.2:80"},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2648,7 +2648,7 @@ func Test_buildConfig(t *testing.T) {
|
|||
URL: "http://127.0.0.1:9999",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2786,5 +2786,4 @@ func extractNamespacesFromProvider(providers []*Provider) []string {
|
|||
return res
|
||||
}
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
|
|
@ -11,8 +11,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/types"
|
||||
)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
||||
func Test_buildConfiguration(t *testing.T) {
|
||||
testCases := []struct {
|
||||
|
@ -60,7 +59,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -123,7 +122,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -133,7 +132,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -199,7 +198,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
|
@ -209,7 +208,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://128.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -262,7 +261,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -377,7 +376,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -466,7 +465,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -529,7 +528,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -580,7 +579,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -641,7 +640,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -685,7 +684,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -781,7 +780,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -833,7 +832,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -942,7 +941,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.2:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -971,7 +970,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1046,7 +1045,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1083,7 +1082,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(100),
|
||||
TerminationDelay: pointer(100),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1175,7 +1174,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
Address: "127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
TerminationDelay: Int(200),
|
||||
TerminationDelay: pointer(200),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1238,7 +1237,7 @@ func Test_buildConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: Bool(true),
|
||||
PassHostHeader: pointer(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -31,7 +31,7 @@ func New(staticCfg static.Configuration) *Provider {
|
|||
}
|
||||
|
||||
// ThrottleDuration returns the throttle duration.
|
||||
func (i Provider) ThrottleDuration() time.Duration {
|
||||
func (i *Provider) ThrottleDuration() time.Duration {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue