Skip to content

Commit

Permalink
docker api 1.22 is deprecated -> minimal supported version is 1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
shamanod authored and umputun committed Feb 1, 2024
1 parent fe24cf9 commit 7ce7e18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/discovery/provider/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/discovery/provider/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7ce7e18

Please sign in to comment.