Skip to content

Commit d6b4880

Browse files
committed
cmd-import: don't use --preserve-digests when importing from containers-storage
There's no digest to preserve in that case since it's all uncompressed. Relevant only in the `--direct` path.
1 parent 2578ad2 commit d6b4880

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cmd-import

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ def generate_oci_archive(args, tmpd):
7878
print(f"Copying {args.srcimg.partition(':')[2]} to {tmpf}")
7979
shutil.copy(args.srcimg.partition(':')[2], tmpf)
8080
else:
81-
subprocess.check_call(['skopeo', 'copy', '--preserve-digests', args.srcimg,
82-
f"oci-archive:{tmpf}"])
81+
extra_args = []
82+
# in the containers-storage case, there's no digest to preserve
83+
if not args.srcimg.startswith('containers-storage'):
84+
extra_args += ['--preserve-digests']
85+
subprocess.check_call(['skopeo', 'copy', args.srcimg, f"oci-archive:{tmpf}"] + extra_args)
8386
return tmpf
8487

8588

0 commit comments

Comments
 (0)