mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix idempotency of docker_compose_v2_pull. (#814)
This commit is contained in:
@@ -409,6 +409,8 @@ def has_changes(events, ignore_service_pull_events=False):
|
||||
if ignore_service_pull_events and event.status in DOCKER_STATUS_PULL:
|
||||
continue
|
||||
return True
|
||||
if event.resource_type == ResourceType.IMAGE_LAYER and event.status in DOCKER_PULL_PROGRESS_WORKING:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ extends_documentation_fragment:
|
||||
attributes:
|
||||
check_mode:
|
||||
support: full
|
||||
details:
|
||||
- In check mode, pulling the image does not result in a changed result.
|
||||
diff_mode:
|
||||
support: none
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ extends_documentation_fragment:
|
||||
attributes:
|
||||
check_mode:
|
||||
support: full
|
||||
details:
|
||||
- If O(policy=always), the module will always indicate a change.
|
||||
Docker Compose does not give any information whether pulling would
|
||||
update the image or not.
|
||||
diff_mode:
|
||||
support: none
|
||||
|
||||
@@ -131,7 +135,7 @@ class PullManager(BaseComposeManager):
|
||||
rc, stdout, stderr = self.client.call_cli(*args, cwd=self.project_src)
|
||||
events = self.parse_events(stderr, dry_run=self.check_mode)
|
||||
self.emit_warnings(events)
|
||||
self.update_result(result, events, stdout, stderr)
|
||||
self.update_result(result, events, stdout, stderr, ignore_service_pull_events=self.policy != 'missing' and not self.check_mode)
|
||||
self.update_failed(result, events, args, stdout, stderr, rc)
|
||||
self.cleanup_result(result)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user