community.docker/plugins/module_utils
Paul Berruti 2019cd8f3c fix: Handle tag@digest format in pull_image methods
When using combined image:tag@digest references, parse_repository_tag
returns (repo, "tag@digest"). The Docker SDK and API don't accept
tag@digest in the tag parameter, causing "invalid tag format" errors.

This fix:
1. Adds build_pull_arguments() helper function to _util.py
2. Uses the helper in both pull_image implementations
3. When tag contains @ (but isn't a pure digest), passes the full
   reference as the repository/fromImage parameter instead of splitting

Tested formats:
- portainer/portainer-ee:2.35.0-alpine@sha256:abc...
- ghcr.io/gethomepage/homepage:v1.7@sha256:abc...
- localhost:5000/myapp:v2.0@sha256:abc...

The existing filter_images_by_tag already handles tag@digest for
lookups, so find_image continues to work correctly.

Includes comprehensive unit tests for build_pull_arguments().
2025-11-23 19:13:11 -08:00
..
_api Fix parse_repository_tag to handle images with both tag and digest 2025-11-22 16:58:54 -08:00
_module_container Improve error/warning messages w.r.t. YAML quoting (#1205) 2025-11-16 12:32:51 +01:00
_common_api.py fix: Handle tag@digest format in pull_image methods 2025-11-23 19:13:11 -08:00
_common_cli.py Work around Docker 29.0.0 bug. (#1187) 2025-11-12 19:21:55 +01:00
_common.py fix: Handle tag@digest format in pull_image methods 2025-11-23 19:13:11 -08:00
_compose_v2.py Fix typing info. (#1183) 2025-11-06 07:15:05 +01:00
_copy.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
_image_archive.py Add typing information, 1/2 (#1176) 2025-10-23 07:05:42 +02:00
_logfmt.py Add typing information, 1/2 (#1176) 2025-10-23 07:05:42 +02:00
_platform.py Add typing information, 1/2 (#1176) 2025-10-23 07:05:42 +02:00
_scramble.py Python code modernization, 8/n (#1179) 2025-10-25 00:36:04 +00:00
_socket_handler.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
_socket_helper.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
_swarm.py Cleanup with ruff check (#1182) 2025-10-28 06:58:15 +01:00
_util.py fix: Handle tag@digest format in pull_image methods 2025-11-23 19:13:11 -08:00
_version.py Python code modernization, 2/n (#1156) 2025-10-09 20:46:48 +02:00