From 5a8a42466e3ffdc89c4a7b80018ee60ae77e32bc Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 14 Jan 2025 13:23:38 +0100 Subject: [PATCH] image load: don't depend on deprecated JSONMessage.error field The error field was deprecated in favor of the errorDetail struct in [moby@3043c26], but the API continued to return both. This patch updates docker-py to not depend on the deprecated field. [moby@3043c26]: https://github.com/moby/moby/commit/3043c2641990d94298c6377b7ef14709263a4709 Signed-off-by: Sebastiaan van Stijn --- docker/models/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/models/images.py b/docker/models/images.py index 4f058d24..0e8cce3f 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -407,8 +407,8 @@ class ImageCollection(Collection): if match: image_id = match.group(2) images.append(image_id) - if 'error' in chunk: - raise ImageLoadError(chunk['error']) + if 'errorDetail' in chunk: + raise ImageLoadError(chunk['errorDetail']['message']) return [self.get(i) for i in images]