community.docker/tests/unit/plugins/module_utils/_api
Paul Berruti 9e666af1ab Fix parse_repository_tag to handle images with both tag and digest
The parse_repository_tag() function was incorrectly parsing Docker image
references that contained both a tag and a digest (e.g., nginx:1.0@sha256:abc).

Previously, when splitting by '@' first, the tag would be included in the
repository name, resulting in incorrect parsing:
- Input: "nginx:1.0@sha256:abc123"
- Old output: ("nginx:1.0", "sha256:abc123")
- Expected: ("nginx", "1.0@sha256:abc123")

The fix now:
1. Checks for digest (@) separator first
2. Examines the part before the digest for a tag (:) separator
3. Combines tag and digest as "tag@digest" when both are present

Added test cases:
- test_index_image_tag_and_sha
- test_index_user_image_tag_and_sha
- test_private_reg_image_tag_and_sha
2025-11-22 16:58:54 -08:00
..
api Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
transport Add typing information, 2/n (#1178) 2025-10-25 01:16:04 +02:00
utils Fix parse_repository_tag to handle images with both tag and digest 2025-11-22 16:58:54 -08:00
constants.py Python code modernization, 3/n (#1157) 2025-10-10 08:11:58 +02:00
fake_api.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
fake_stat.py Python code modernization, 3/n (#1157) 2025-10-10 08:11:58 +02:00
test_auth.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
test_context.py Add typing information, 2/n (#1178) 2025-10-25 01:16:04 +02:00
test_errors.py Add typing information, 2/n (#1178) 2025-10-25 01:16:04 +02:00