Skip to content

Commit

Permalink
Don't pull image when state is absent or pull=never (#889)
Browse files Browse the repository at this point in the history
fix #888
Signed-off-by: Sagi Shnaidman <[email protected]>
  • Loading branch information
sshnaidm authored Jan 8, 2025
1 parent 7fa610a commit 64e4247
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/module_utils/podman/podman_container_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,8 +1734,9 @@ def __init__(self, module, params):
required=True)
self.image = self.module_params['image']
self.state = self.module_params['state']
disable_image_pull = self.state in ('quadlet', 'absent') or self.module_params['pull'] == 'never'
image_actions = ensure_image_exists(
self.module, self.image, self.module_params) if self.state != 'quadlet' else []
self.module, self.image, self.module_params) if not disable_image_pull else []
self.results['actions'] += image_actions

self.restart = self.module_params['force_restart']
Expand Down

0 comments on commit 64e4247

Please sign in to comment.