1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/plugins/module_utils/podman
Sergey 8f0bc79e6f
Fix podman_image correct delimiter logic for version@digest tags (#960)
Fix incorrect image URL formation when using separate name and tag parameters
where the tag contains a digest. Previously, tags like "8-bookworm@sha256:..."
would incorrectly use "@" as the delimiter between name and tag, resulting in
malformed URLs like "docker.io/valkey/valkey@8-bookworm@sha256:...".
The issue was in ImageRepository.delimiter logic which used substring matching
("sha256" in tag) instead of checking for pure digest format.
Changes:
  - Fix delimiter selection in ImageRepository.__init__() to only use "@" for
    pure digests starting with "sha256:", not any tag containing "sha256"
  - Add comprehensive unit tests covering all delimiter scenarios
  - Add integration tests with real digest validation and edge cases
  - Ensure proper URL formation: name:tag@digest vs name@digest

Before: docker.io/valkey/valkey@8-bookworm@sha256:abc123 (broken)
After:  docker.io/valkey/valkey:8-bookworm@sha256:abc123 (correct)

Fixes #947
Generated with [Claude Code](https://claude.ai/code)

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-05 23:05:17 +03:00
..
__init__.py Migration of Podman modules from Ansible to Containers 2020-03-06 16:29:20 +02:00
common.py Run black -l 120 on all files, again (#943) 2025-06-26 13:24:44 +03:00
podman_container_lib.py Run black -l 120 on all files, again (#943) 2025-06-26 13:24:44 +03:00
podman_image_lib.py Fix podman_image correct delimiter logic for version@digest tags (#960) 2025-08-05 23:05:17 +03:00
podman_pod_lib.py Run black -l 120 on all files, again (#943) 2025-06-26 13:24:44 +03:00
quadlet.py Run black -l 120 on all files, again (#943) 2025-06-26 13:24:44 +03:00