mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Update podman image module to support docker-archive transport more cleanly
This commit is contained in:
parent
edbb1ab1db
commit
35ac9316cc
1 changed files with 10 additions and 2 deletions
|
|
@ -602,7 +602,12 @@ class PodmanImageManager(object):
|
|||
return self.inspect_image(last_id)
|
||||
|
||||
def push_image(self):
|
||||
args = ['push']
|
||||
transport = self.push_args.get('transport')
|
||||
|
||||
if transport == 'docker-archive':
|
||||
args = ['save']
|
||||
else:
|
||||
args = ['push']
|
||||
|
||||
if self.validate_certs is not None:
|
||||
if self.validate_certs:
|
||||
|
|
@ -659,6 +664,9 @@ class PodmanImageManager(object):
|
|||
self.module.fail_json("'push_args['transport'] requires 'push_args['dest'] but it was not provided.")
|
||||
if transport == 'docker':
|
||||
dest_format_string = '{transport}://{dest}'
|
||||
elif transport == 'docker-archive':
|
||||
args.append('--output')
|
||||
dest_format_string = '{dest}'
|
||||
elif transport == 'ostree':
|
||||
dest_format_string = '{transport}:{name}@{dest}'
|
||||
else:
|
||||
|
|
@ -667,7 +675,7 @@ class PodmanImageManager(object):
|
|||
dest_string = dest_format_string.format(transport=transport, name=self.name, dest=dest, image_name=self.image_name,)
|
||||
|
||||
# Only append the destination argument if the image name is not a URL
|
||||
if '/' not in self.name:
|
||||
if '/' not in self.name or transport == 'docker-archive':
|
||||
args.append(dest_string)
|
||||
|
||||
rc, out, err = self._run(args, ignore_errors=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue