diff --git a/integration/docker_test.go b/integration/docker_test.go index 8ae24d921..88d185454 100644 --- a/integration/docker_test.go +++ b/integration/docker_test.go @@ -1,7 +1,6 @@ package integration import ( - "encoding/json" "io" "net/http" "testing" @@ -75,16 +74,8 @@ func (s *DockerSuite) TestDefaultDockerContainers() { require.NoError(s.T(), err) 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) - - 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() { @@ -139,16 +130,8 @@ func (s *DockerSuite) TestDockerContainersWithLabels() { require.NoError(s.T(), err) 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) - - 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() { @@ -197,17 +180,9 @@ func (s *DockerSuite) TestRestartDockerContainers() { req.Host = "my.super.host" // 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) - 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")) require.NoError(s.T(), err) diff --git a/integration/resources/compose/docker.yml b/integration/resources/compose/docker.yml index 783d5be38..76d1ad575 100644 --- a/integration/resources/compose/docker.yml +++ b/integration/resources/compose/docker.yml @@ -1,7 +1,6 @@ services: simple: - image: swarm:1.0.0 - command: [ "manage", "token://blablabla" ] + image: traefik/whoami withtcplabels: image: traefik/whoamitcp @@ -12,26 +11,24 @@ services: traefik.tcp.Services.Super.Loadbalancer.server.port: 8080 withlabels1: - image: swarm:1.0.0 - command: [ "manage", "token://blabla" ] + image: traefik/whoami labels: traefik.http.Routers.Super.Rule: Host(`my.super.host`) withlabels2: - image: swarm:1.0.0 - command: [ "manage", "token://blablabla" ] + image: traefik/whoami labels: traefik.http.Routers.SuperHost.Rule: Host(`my-super.host`) withonelabelmissing: - image: swarm:1.0.0 - command: [ "manage", "token://blabla" ] + image: traefik/whoami labels: traefik.random.value: my.super.host powpow: - image: swarm:1.0.0 - command: [ "manage", "token://blabla" ] + image: traefik/whoami + command: + - --port=2375 labels: traefik.http.Routers.Super.Rule: Host(`my.super.host`) traefik.http.Services.powpow.LoadBalancer.server.Port: 2375