mirror of
https://github.com/traefik/traefik.git
synced 2026-06-17 19:09:29 +03:00
Merge branch v2.11 into v3.6
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package integration
|
package integration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -75,16 +74,8 @@ func (s *DockerSuite) TestDefaultDockerContainers() {
|
|||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
req.Host = "simple.docker.localhost"
|
req.Host = "simple.docker.localhost"
|
||||||
|
|
||||||
resp, err := try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK)
|
_, err = try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK)
|
||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
require.NoError(s.T(), err)
|
|
||||||
|
|
||||||
var version map[string]any
|
|
||||||
|
|
||||||
assert.NoError(s.T(), json.Unmarshal(body, &version))
|
|
||||||
assert.Equal(s.T(), "swarm/1.0.0", version["Version"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestDockerContainersWithTCPLabels() {
|
func (s *DockerSuite) TestDockerContainersWithTCPLabels() {
|
||||||
@@ -139,16 +130,8 @@ func (s *DockerSuite) TestDockerContainersWithLabels() {
|
|||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
req.Host = "my.super.host"
|
req.Host = "my.super.host"
|
||||||
|
|
||||||
resp, err := try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK)
|
_, err = try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK)
|
||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
require.NoError(s.T(), err)
|
|
||||||
|
|
||||||
var version map[string]any
|
|
||||||
|
|
||||||
assert.NoError(s.T(), json.Unmarshal(body, &version))
|
|
||||||
assert.Equal(s.T(), "swarm/1.0.0", version["Version"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestDockerContainersWithOneMissingLabels() {
|
func (s *DockerSuite) TestDockerContainersWithOneMissingLabels() {
|
||||||
@@ -197,17 +180,9 @@ func (s *DockerSuite) TestRestartDockerContainers() {
|
|||||||
req.Host = "my.super.host"
|
req.Host = "my.super.host"
|
||||||
|
|
||||||
// TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?)
|
// TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?)
|
||||||
resp, err := try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK)
|
_, err = try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK)
|
||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
require.NoError(s.T(), err)
|
|
||||||
|
|
||||||
var version map[string]any
|
|
||||||
|
|
||||||
assert.NoError(s.T(), json.Unmarshal(body, &version))
|
|
||||||
assert.Equal(s.T(), "swarm/1.0.0", version["Version"])
|
|
||||||
|
|
||||||
err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("powpow"))
|
err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("powpow"))
|
||||||
require.NoError(s.T(), err)
|
require.NoError(s.T(), err)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
simple:
|
simple:
|
||||||
image: swarm:1.0.0
|
image: traefik/whoami
|
||||||
command: [ "manage", "token://blablabla" ]
|
|
||||||
|
|
||||||
withtcplabels:
|
withtcplabels:
|
||||||
image: traefik/whoamitcp
|
image: traefik/whoamitcp
|
||||||
@@ -12,26 +11,24 @@ services:
|
|||||||
traefik.tcp.Services.Super.Loadbalancer.server.port: 8080
|
traefik.tcp.Services.Super.Loadbalancer.server.port: 8080
|
||||||
|
|
||||||
withlabels1:
|
withlabels1:
|
||||||
image: swarm:1.0.0
|
image: traefik/whoami
|
||||||
command: [ "manage", "token://blabla" ]
|
|
||||||
labels:
|
labels:
|
||||||
traefik.http.Routers.Super.Rule: Host(`my.super.host`)
|
traefik.http.Routers.Super.Rule: Host(`my.super.host`)
|
||||||
|
|
||||||
withlabels2:
|
withlabels2:
|
||||||
image: swarm:1.0.0
|
image: traefik/whoami
|
||||||
command: [ "manage", "token://blablabla" ]
|
|
||||||
labels:
|
labels:
|
||||||
traefik.http.Routers.SuperHost.Rule: Host(`my-super.host`)
|
traefik.http.Routers.SuperHost.Rule: Host(`my-super.host`)
|
||||||
|
|
||||||
withonelabelmissing:
|
withonelabelmissing:
|
||||||
image: swarm:1.0.0
|
image: traefik/whoami
|
||||||
command: [ "manage", "token://blabla" ]
|
|
||||||
labels:
|
labels:
|
||||||
traefik.random.value: my.super.host
|
traefik.random.value: my.super.host
|
||||||
|
|
||||||
powpow:
|
powpow:
|
||||||
image: swarm:1.0.0
|
image: traefik/whoami
|
||||||
command: [ "manage", "token://blabla" ]
|
command:
|
||||||
|
- --port=2375
|
||||||
labels:
|
labels:
|
||||||
traefik.http.Routers.Super.Rule: Host(`my.super.host`)
|
traefik.http.Routers.Super.Rule: Host(`my.super.host`)
|
||||||
traefik.http.Services.powpow.LoadBalancer.server.Port: 2375
|
traefik.http.Services.powpow.LoadBalancer.server.Port: 2375
|
||||||
|
|||||||
Reference in New Issue
Block a user