community.docker/tests
Paul Berruti 0525a802bb fix: Match by digest only for combined tag@digest image lookups
When using combined tag@digest references (e.g., nginx:1.21@sha256:abc...),
Docker does NOT store the tag in RepoTags. It only stores the digest in
RepoDigests. The previous implementation required BOTH to match, which
always failed because RepoTags was empty.

This caused docker_container to pull the image on every run even when
the image with the correct digest already existed locally, breaking
idempotency.

The fix: When a digest is specified, match by digest only since it's the
authoritative identifier. The tag is informational for human readability.

Real-world example from docker image inspect:
  "RepoTags": [],  # Empty when pulled by digest\!
  "RepoDigests": ["portainer/portainer-ee@sha256:7ecf2008..."]

Updated tests to reflect the correct behavior:
- test_empty_repo_tags_matches_by_digest (the critical fix case)
- test_combined_tag_digest_matches_even_if_tag_differs
- test_multiple_tags_irrelevant_for_combined
2025-11-23 21:40:32 -08:00
..
ee Use FQCNs. (#1180) 2025-10-25 10:12:21 +02:00
images Add Distribution 3.0.0 image. 2025-08-03 14:18:29 +02:00
integration Improve error/warning messages w.r.t. YAML quoting (#1205) 2025-11-16 12:32:51 +01:00
sanity Add typing information, 2/n (#1178) 2025-10-25 01:16:04 +02:00
unit fix: Match by digest only for combined tag@digest image lookups 2025-11-23 21:40:32 -08:00
utils Restrict cffi on Python 2. (#1126) 2025-09-12 19:58:48 +02:00
config.yml Since we require ansible-core >= 2.15, nothing before Python 2.7 is supported and used in tests anyway. 2025-04-27 12:24:53 +02:00