mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Have docker.save use the image name when valid if not use image id, issue when loading and image is savid with id issue #43043
This commit is contained in:
parent
7b0c94768a
commit
0ffc57d1df
1 changed files with 3 additions and 2 deletions
|
@ -3880,8 +3880,9 @@ def save(name,
|
|||
saved_path = salt.utils.files.mkstemp()
|
||||
else:
|
||||
saved_path = path
|
||||
|
||||
cmd = ['docker', 'save', '-o', saved_path, inspect_image(name)['Id']]
|
||||
# use the image name if its valid if not use the image id
|
||||
image_to_save = name if name in inspect_image(name)['RepoTags'] else inspect_image(name)['Id']
|
||||
cmd = ['docker', 'save', '-o', saved_path, image_to_save]
|
||||
time_started = time.time()
|
||||
result = __salt__['cmd.run_all'](cmd, python_shell=False)
|
||||
if result['retcode'] != 0:
|
||||
|
|
Loading…
Add table
Reference in a new issue