mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
(cherry picked from commit c2e48a1ae3)
This commit is contained in:
parent
4adf0ed22f
commit
7b45d96c94
2
changelogs/fragments/1242-pull.yml
Normal file
2
changelogs/fragments/1242-pull.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "docker_image_pull, docker_container - fix pulled image change detection for Docker 29.2+ (https://github.com/ansible-collections/community.docker/pull/1242)."
|
||||||
@ -424,7 +424,10 @@ class AnsibleDockerClientBase(Client):
|
|||||||
def _compare_images(img1, img2):
|
def _compare_images(img1, img2):
|
||||||
if img1 is None or img2 is None:
|
if img1 is None or img2 is None:
|
||||||
return img1 == img2
|
return img1 == img2
|
||||||
filter_keys = {"Metadata"}
|
filter_keys = {"Metadata", "Identity"}
|
||||||
|
# Since Docker 29.2 (?) the order of entries in Identity.Pull can change
|
||||||
|
# even though the image is the same. Since we're only really interested
|
||||||
|
# in the image's Id field, we simply skip all of Identity.
|
||||||
img1_filtered = {k: v for k, v in img1.items() if k not in filter_keys}
|
img1_filtered = {k: v for k, v in img1.items() if k not in filter_keys}
|
||||||
img2_filtered = {k: v for k, v in img2.items() if k not in filter_keys}
|
img2_filtered = {k: v for k, v in img2.items() if k not in filter_keys}
|
||||||
return img1_filtered == img2_filtered
|
return img1_filtered == img2_filtered
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user