mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 11:53:31 +00:00
Fix pull change detection. (#1242)
This commit is contained in:
parent
8f7dfa61fd
commit
c2e48a1ae3
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)."
|
||||||
@ -523,7 +523,10 @@ class AnsibleDockerClientBase(Client):
|
|||||||
) -> bool:
|
) -> bool:
|
||||||
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