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]: 3043c26419

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-01-14 13:23:38 +01:00
parent 03e43be6af
commit 5a8a42466e
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 2 deletions

View File

@ -407,8 +407,8 @@ class ImageCollection(Collection):
if match: if match:
image_id = match.group(2) image_id = match.group(2)
images.append(image_id) images.append(image_id)
if 'error' in chunk: if 'errorDetail' in chunk:
raise ImageLoadError(chunk['error']) raise ImageLoadError(chunk['errorDetail']['message'])
return [self.get(i) for i in images] return [self.get(i) for i in images]