From e47e966e944deb637a16f445abd5fc92f6dba38a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 22 May 2024 15:12:42 +0200 Subject: [PATCH] Bump default API version to 1.45 (Moby 26.0/26.1) - Update API version to the latest maintained release. 0 Adjust tests for API 1.45 Signed-off-by: Sebastiaan van Stijn --- Makefile | 4 ++-- docker/constants.py | 2 +- tests/Dockerfile-ssh-dind | 4 ++-- tests/integration/models_containers_test.py | 11 +++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 13a00f5e2..d1c07ac73 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -TEST_API_VERSION ?= 1.44 -TEST_ENGINE_VERSION ?= 25.0 +TEST_API_VERSION ?= 1.45 +TEST_ENGINE_VERSION ?= 26.1 ifeq ($(OS),Windows_NT) PLATFORM := Windows diff --git a/docker/constants.py b/docker/constants.py index 3c527b47e..0e39dc291 100644 --- a/docker/constants.py +++ b/docker/constants.py @@ -2,7 +2,7 @@ from .version import __version__ -DEFAULT_DOCKER_API_VERSION = '1.44' +DEFAULT_DOCKER_API_VERSION = '1.45' MINIMUM_DOCKER_API_VERSION = '1.24' DEFAULT_TIMEOUT_SECONDS = 60 STREAM_HEADER_SIZE_BYTES = 8 diff --git a/tests/Dockerfile-ssh-dind b/tests/Dockerfile-ssh-dind index 250c20f2c..49529f84b 100644 --- a/tests/Dockerfile-ssh-dind +++ b/tests/Dockerfile-ssh-dind @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 -ARG API_VERSION=1.44 -ARG ENGINE_VERSION=25.0 +ARG API_VERSION=1.45 +ARG ENGINE_VERSION=26.1 FROM docker:${ENGINE_VERSION}-dind diff --git a/tests/integration/models_containers_test.py b/tests/integration/models_containers_test.py index 2cd713ec8..872745593 100644 --- a/tests/integration/models_containers_test.py +++ b/tests/integration/models_containers_test.py @@ -131,10 +131,9 @@ def test_run_with_networking_config(self): assert 'NetworkSettings' in attrs assert 'Networks' in attrs['NetworkSettings'] assert list(attrs['NetworkSettings']['Networks'].keys()) == [net_name] - # Expect Aliases to list 'test_alias' and the container's short-id. - # In API version 1.45, the short-id will be removed. + # Aliases no longer include the container's short-id in API v1.45. assert attrs['NetworkSettings']['Networks'][net_name]['Aliases'] \ - == [test_alias, attrs['Id'][:12]] + == [test_alias] assert attrs['NetworkSettings']['Networks'][net_name]['DriverOpts'] \ == test_driver_opt @@ -191,9 +190,9 @@ def test_run_with_networking_config_only_undeclared_network(self): assert 'NetworkSettings' in attrs assert 'Networks' in attrs['NetworkSettings'] assert list(attrs['NetworkSettings']['Networks'].keys()) == [net_name] - # Aliases should include the container's short-id (but it will be removed - # in API v1.45). - assert attrs['NetworkSettings']['Networks'][net_name]['Aliases'] == [attrs["Id"][:12]] + # Aliases no longer include the container's short-id in API v1.45. + assert (attrs['NetworkSettings']['Networks'][net_name]['Aliases'] + is None) assert (attrs['NetworkSettings']['Networks'][net_name]['DriverOpts'] is None)