mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
docker_image: Fix up 'changed' event in force mode (#33754)
* docker_image: Fix up 'changed' event in force mode This is the same as https://github.com/ansible/ansible/pull/19235 except it applies to all image-building modes (building the image locally, loading the image from an archive, or pulling the image), rather than only when pulling the image. * Use 'dummy' rather than '_' as unused variable name. * Add changelog fragment for pull request #33754
This commit is contained in:
parent
2596ac196f
commit
e217ba6e19
2 changed files with 5 additions and 3 deletions
|
@ -348,9 +348,9 @@ class ImageManager(DockerBaseClass):
|
|||
self.results['actions'].append('Pulled image %s:%s' % (self.name, self.tag))
|
||||
self.results['changed'] = True
|
||||
if not self.check_mode:
|
||||
self.results['image'], already_latest = self.client.pull_image(self.name, tag=self.tag)
|
||||
if already_latest:
|
||||
self.results['changed'] = False
|
||||
self.results['image'], dummy = self.client.pull_image(self.name, tag=self.tag)
|
||||
if not self.check_mode and image and image['Id'] == self.results['image']['Id']:
|
||||
self.results['changed'] = False
|
||||
|
||||
if self.archive_path:
|
||||
self.archive_image(self.name, self.tag)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue