Merge branch v2.11 into v3.0

This commit is contained in:
Fernandez Ludovic 2024-04-03 17:44:16 +02:00
commit 9f145dbc28
130 changed files with 245 additions and 322 deletions

View file

@ -3,6 +3,7 @@ package router
import (
"context"
"io"
"math"
"net/http"
"net/http/httptest"
"strings"
@ -297,7 +298,6 @@ func TestRouterManager_Get(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -574,6 +574,32 @@ func TestRuntimeConfiguration(t *testing.T) {
},
expectedError: 2,
},
{
desc: "Router priority exceeding max user-defined priority",
serviceConfig: map[string]*dynamic.Service{
"foo-service": {
LoadBalancer: &dynamic.ServersLoadBalancer{
Servers: []dynamic.Server{
{
URL: "http://127.0.0.1",
},
},
},
},
},
middlewareConfig: map[string]*dynamic.Middleware{},
routerConfig: map[string]*dynamic.Router{
"bar": {
EntryPoints: []string{"web"},
Service: "foo-service",
Rule: "Host(`foo.bar`)",
Priority: math.MaxInt,
TLS: &dynamic.RouterTLSConfig{},
},
},
tlsOptions: map[string]tls.Options{},
expectedError: 1,
},
{
desc: "Router with broken tlsOption",
serviceConfig: map[string]*dynamic.Service{
@ -640,7 +666,6 @@ func TestRuntimeConfiguration(t *testing.T) {
},
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()