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:
parent
e37123e06f
commit
8f0bc79e6f
3 changed files with 206 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ class ImageRepository:
|
|||
self.original_name = name
|
||||
self.name, self.parsed_tag = self._parse_repository_tag(name)
|
||||
self.tag = self.parsed_tag or tag
|
||||
self.delimiter = "@" if "sha256" in self.tag else ":"
|
||||
self.delimiter = "@" if self.tag.startswith("sha256:") else ":"
|
||||
self.full_name = f"{self.name}{self.delimiter}{self.tag}"
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue