1
0
Fork 0

Merge branch v3.2 into master

This commit is contained in:
kevinpollet 2024-11-21 11:45:02 +01:00
commit 090db6d4b0
No known key found for this signature in database
GPG key ID: 0C9A5DDD1B292453
76 changed files with 1823 additions and 1016 deletions

View file

@ -15,8 +15,7 @@ import (
"github.com/traefik/traefik/v3/pkg/types"
)
func Bool(v bool) *bool { return &v }
func String(v string) *string { return &v }
func pointer[T any](v T) *T { return &v }
func Test_buildConfiguration(t *testing.T) {
provider := newProviderMock(mapToPairs(map[string]string{
@ -387,7 +386,7 @@ func Test_buildConfiguration(t *testing.T) {
"foobar",
"foobar",
},
ForceSlash: Bool(true),
ForceSlash: pointer(true),
},
},
"Middleware00": {
@ -430,7 +429,7 @@ func Test_buildConfiguration(t *testing.T) {
Cert: "foobar",
Key: "foobar",
InsecureSkipVerify: true,
CAOptional: Bool(true),
CAOptional: pointer(true),
},
TrustForwardHeader: true,
AuthResponseHeaders: []string{
@ -603,14 +602,14 @@ func Test_buildConfiguration(t *testing.T) {
"foobar",
"foobar",
},
SSLRedirect: Bool(true),
SSLTemporaryRedirect: Bool(true),
SSLHost: String("foobar"),
SSLRedirect: pointer(true),
SSLTemporaryRedirect: pointer(true),
SSLHost: pointer("foobar"),
SSLProxyHeaders: map[string]string{
"name1": "foobar",
"name0": "foobar",
},
SSLForceHost: Bool(true),
SSLForceHost: pointer(true),
STSSeconds: 42,
STSIncludeSubdomains: true,
STSPreload: true,
@ -624,7 +623,7 @@ func Test_buildConfiguration(t *testing.T) {
ContentSecurityPolicyReportOnly: "foobar",
PublicKey: "foobar",
ReferrerPolicy: "foobar",
FeaturePolicy: String("foobar"),
FeaturePolicy: pointer("foobar"),
PermissionsPolicy: "foobar",
IsDevelopment: true,
},
@ -665,13 +664,13 @@ func Test_buildConfiguration(t *testing.T) {
Interval: ptypes.Duration(time.Second),
Timeout: ptypes.Duration(time.Second),
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: ptypes.Duration(time.Second),
},
@ -680,8 +679,8 @@ func Test_buildConfiguration(t *testing.T) {
"Service02": {
Mirroring: &dynamic.Mirroring{
Service: "foobar",
MirrorBody: func(v bool) *bool { return &v }(true),
MaxBodySize: func(v int64) *int64 { return &v }(42),
MirrorBody: pointer(true),
MaxBodySize: pointer[int64](42),
Mirrors: []dynamic.MirrorService{
{
Name: "foobar",
@ -699,11 +698,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{
@ -788,7 +787,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"},
@ -800,11 +799,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),
},
},
},