1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

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>
This commit is contained in:
Sergey 2025-08-05 23:05:17 +03:00 committed by GitHub
parent e37123e06f
commit 8f0bc79e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 206 additions and 1 deletions

View file

@ -588,6 +588,8 @@
- include_tasks: additional_tests.yml
- include_tasks: test_issue_947.yml
always:
- name: Cleanup images
containers.podman.podman_image: