1
0
Fork 0

Merge current v2.11 into v3.0

This commit is contained in:
mmatur 2024-03-12 10:38:29 +01:00
commit 05be441027
No known key found for this signature in database
GPG key ID: 2FFE42FC256CFF8E
156 changed files with 5826 additions and 8436 deletions

View file

@ -67,7 +67,7 @@ func (s *ThrottlingSuite) TestThrottleConfReload() {
confChanges := 10
for i := 0; i < confChanges; i++ {
for i := range confChanges {
config.HTTP.Routers[fmt.Sprintf("routerHTTP%d", i)] = router
data, err := json.Marshal(config)
require.NoError(s.T(), err)

View file

@ -312,7 +312,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify load-balancing on root still works, and that we're getting an alternation between wsp2, and wsp4.
reachedServers := make(map[string]int)
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(rootReq)
require.NoError(s.T(), err)
@ -352,7 +352,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify load-balancing on foo still works, and that we're getting wsp2, wsp2, wsp2, wsp2, etc.
want := `IP: ` + s.whoami2IP
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(fooReq)
require.NoError(s.T(), err)
@ -368,7 +368,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify load-balancing on bar still works, and that we're getting wsp2, wsp2, wsp2, wsp2, etc.
want = `IP: ` + s.whoami2IP
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(barReq)
require.NoError(s.T(), err)
@ -390,7 +390,7 @@ func (s *HealthCheckSuite) TestPropagate() {
try.Sleep(time.Second)
// Verify that everything is down, and that we get 503s everywhere.
for i := 0; i < 2; i++ {
for range 2 {
resp, err := client.Do(rootReq)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusServiceUnavailable, resp.StatusCode)
@ -417,7 +417,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify everything is up on root router.
reachedServers = make(map[string]int)
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(rootReq)
require.NoError(s.T(), err)
@ -452,7 +452,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify everything is up on foo router.
reachedServers = make(map[string]int)
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(fooReq)
require.NoError(s.T(), err)
@ -487,7 +487,7 @@ func (s *HealthCheckSuite) TestPropagate() {
// Verify everything is up on bar router.
reachedServers = make(map[string]int)
for i := 0; i < 4; i++ {
for range 4 {
resp, err := client.Do(barReq)
require.NoError(s.T(), err)

View file

@ -243,7 +243,7 @@ func (s *BaseSuite) createComposeProject(name string) {
}
if containerConfig.Deploy.Replicas > 0 {
for i := 0; i < containerConfig.Deploy.Replicas; i++ {
for i := range containerConfig.Deploy.Replicas {
id = fmt.Sprintf("%s-%d", id, i+1)
con, err := s.createContainer(ctx, containerConfig, id, mounts)
require.NoError(s.T(), err)

View file

@ -311,7 +311,7 @@ func (s *SimpleSuite) TestMetricsPrometheusTwoRoutersOneService() {
require.NoError(s.T(), err)
// adding a loop to test if metrics are not deleted
for i := 0; i < 10; i++ {
for range 10 {
request, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/metrics", nil)
require.NoError(s.T(), err)
@ -876,7 +876,7 @@ func (s *SimpleSuite) TestWRR() {
require.NoError(s.T(), err)
repartition := map[string]int{}
for i := 0; i < 4; i++ {
for range 4 {
req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil)
require.NoError(s.T(), err)
@ -922,7 +922,7 @@ func (s *SimpleSuite) TestWRRSticky() {
req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil)
require.NoError(s.T(), err)
for i := 0; i < 4; i++ {
for range 4 {
response, err := http.DefaultClient.Do(req)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusOK, response.StatusCode)
@ -978,7 +978,7 @@ func (s *SimpleSuite) TestMirror() {
req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil)
require.NoError(s.T(), err)
for i := 0; i < 10; i++ {
for range 10 {
response, err := http.DefaultClient.Do(req)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusOK, response.StatusCode)
@ -1049,7 +1049,7 @@ func (s *SimpleSuite) TestMirrorWithBody() {
req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", bytes.NewBuffer(body20))
require.NoError(s.T(), err)
req.Header.Set("Size", "20")
for i := 0; i < 10; i++ {
for range 10 {
response, err := http.DefaultClient.Do(req)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusOK, response.StatusCode)
@ -1070,7 +1070,7 @@ func (s *SimpleSuite) TestMirrorWithBody() {
req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoamiWithMaxBody", bytes.NewBuffer(body5))
require.NoError(s.T(), err)
req.Header.Set("Size", "5")
for i := 0; i < 10; i++ {
for range 10 {
response, err := http.DefaultClient.Do(req)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusOK, response.StatusCode)
@ -1091,7 +1091,7 @@ func (s *SimpleSuite) TestMirrorWithBody() {
req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoamiWithMaxBody", bytes.NewBuffer(body20))
require.NoError(s.T(), err)
req.Header.Set("Size", "20")
for i := 0; i < 10; i++ {
for range 10 {
response, err := http.DefaultClient.Do(req)
require.NoError(s.T(), err)
assert.Equal(s.T(), http.StatusOK, response.StatusCode)
@ -1137,7 +1137,7 @@ func (s *SimpleSuite) TestMirrorCanceled() {
err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1"))
require.NoError(s.T(), err)
for i := 0; i < 5; i++ {
for range 5 {
req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil)
require.NoError(s.T(), err)

View file

@ -287,7 +287,7 @@ func (s *TCPSuite) TestWRR() {
require.NoError(s.T(), err)
call := map[string]int{}
for i := 0; i < 4; i++ {
for range 4 {
// Traefik passes through, termination handled by whoami-b or whoami-bb
out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test")
require.NoError(s.T(), err)

View file

@ -53,7 +53,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -69,7 +69,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -53,7 +53,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -69,7 +69,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -6,7 +6,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -22,7 +22,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -6,7 +6,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -22,7 +22,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -6,7 +6,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -22,7 +22,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -6,7 +6,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -22,7 +22,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"
@ -71,4 +71,4 @@
"status": "enabled"
}
}
}
}

View file

@ -6,7 +6,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -22,7 +22,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -53,7 +53,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -69,7 +69,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -53,7 +53,7 @@
],
"service": "api@internal",
"rule": "PathPrefix(`/api`)",
"priority": 2147483646,
"priority": 9223372036854775806,
"status": "enabled",
"using": [
"traefik"
@ -69,7 +69,7 @@
],
"service": "dashboard@internal",
"rule": "PathPrefix(`/`)",
"priority": 2147483645,
"priority": 9223372036854775805,
"status": "enabled",
"using": [
"traefik"

View file

@ -82,7 +82,7 @@ func (s *UDPSuite) TestWRR() {
stop := make(chan struct{})
go func() {
call := map[string]int{}
for i := 0; i < 8; i++ {
for range 8 {
out, err := guessWhoUDP("127.0.0.1:8093")
require.NoError(s.T(), err)
switch {