From 7ce7e18931af177c37526e7cea024ddae888bb06 Mon Sep 17 00:00:00 2001 From: rashpile Date: Thu, 1 Feb 2024 20:18:50 +0000 Subject: [PATCH] docker api 1.22 is deprecated -> minimal supported version is 1.24 --- app/discovery/provider/docker.go | 2 +- app/discovery/provider/docker_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/discovery/provider/docker.go b/app/discovery/provider/docker.go index 70dfd451..38e92fbe 100644 --- a/app/discovery/provider/docker.go +++ b/app/discovery/provider/docker.go @@ -373,7 +373,7 @@ func NewDockerClient(host, network string) DockerClient { func (d *dockerClient) ListContainers() ([]containerInfo, error) { // Minimum API version that returns attached networks // docs.docker.com/engine/api/version-history/#v122-api-changes - const APIVersion = "v1.22" + const APIVersion = "v1.24" resp, err := d.client.Get(fmt.Sprintf("http://localhost/%s/containers/json", APIVersion)) if err != nil { diff --git a/app/discovery/provider/docker_test.go b/app/discovery/provider/docker_test.go index 7efcf4fa..b875220a 100644 --- a/app/discovery/provider/docker_test.go +++ b/app/discovery/provider/docker_test.go @@ -369,7 +369,7 @@ func TestDocker_refresh(t *testing.T) { func TestDockerClient(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, `/v1.22/containers/json`, r.URL.Path) + require.Equal(t, `/v1.24/containers/json`, r.URL.Path) // obtained using curl --unix-socket /var/run/docker.sock http://localhost/v1.41/containers/json resp, err := os.ReadFile("testdata/containers.json")