Skip to content

Commit

Permalink
Merge branch 'main' into fix/exec_run_detached_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGLW authored Nov 20, 2024
2 parents c90859b + 03e43be commit e02904c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM python:${PYTHON_VERSION}
WORKDIR /src
COPY . .

ARG VERSION
ARG VERSION=0.0.0.dev0
RUN --mount=type=cache,target=/cache/pip \
PIP_CACHE_DIR=/cache/pip \
SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-docs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN addgroup --gid $gid sphinx \
WORKDIR /src
COPY . .

ARG VERSION
ARG VERSION=0.0.0.dev0
RUN --mount=type=cache,target=/cache/pip \
PIP_CACHE_DIR=/cache/pip \
SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} \
Expand Down
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +13,7 @@ endif

SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER ?= $(shell git describe --match '[0-9]*' --dirty='.m' --always --tags 2>/dev/null | sed -r 's/-([0-9]+)/.dev\1/' | sed 's/-/+/')
ifeq ($(SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER),)
SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER = "dev"
SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER = "0.0.0.dev0"
endif

.PHONY: all
Expand All @@ -33,7 +33,7 @@ build-dind-ssh:
--build-arg VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER} \
--build-arg ENGINE_VERSION=${TEST_ENGINE_VERSION} \
--build-arg API_VERSION=${TEST_API_VERSION} \
--build-arg APT_MIRROR .
.

.PHONY: build
build:
Expand All @@ -42,7 +42,7 @@ build:
-t docker-sdk-python3 \
-f tests/Dockerfile \
--build-arg VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER} \
--build-arg APT_MIRROR .
.

.PHONY: build-docs
build-docs:
Expand Down Expand Up @@ -76,9 +76,6 @@ integration-test: build
setup-network:
docker network inspect dpy-tests || docker network create dpy-tests

.PHONY: integration-dind
integration-dind: integration-dind

.PHONY: integration-dind
integration-dind: build setup-network
docker rm -vf dpy-dind || :
Expand Down
2 changes: 1 addition & 1 deletion docker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN curl -sSL -o /opt/docker-credential-pass.tar.gz \
WORKDIR /src
COPY . .

ARG VERSION
ARG VERSION=0.0.0.dev0
RUN --mount=type=cache,target=/cache/pip \
PIP_CACHE_DIR=/cache/pip \
SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} \
Expand Down
4 changes: 2 additions & 2 deletions tests/Dockerfile-ssh-dind
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions tests/integration/api_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import docker

from ..helpers import force_leave_swarm, requires_api_version, requires_experimental
from ..helpers import force_leave_swarm, requires_api_version
from .base import TEST_IMG, BaseAPIIntegrationTest


Expand Down Expand Up @@ -140,8 +140,7 @@ def test_create_service_simple(self):
assert len(services) == 1
assert services[0]['ID'] == svc_id['ID']

@requires_api_version('1.25')
@requires_experimental(until='1.29')
@requires_api_version('1.29')
def test_service_logs(self):
name, svc_id = self.create_simple_service()
assert self.get_service_container(name, include_stopped=True)
Expand Down
11 changes: 5 additions & 6 deletions tests/integration/models_containers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit e02904c

Please sign in to comment.