chore: update linter
This commit is contained in:
parent
9c50129520
commit
f437fb4230
38 changed files with 796 additions and 830 deletions
|
@ -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),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue