@@ -43,9 +43,13 @@ def main():
43
43
sys.exit(1)
44
44
45
45
with tempfile.TemporaryDirectory(prefix='cosa-import-', dir='tmp') as tmpd:
46
- # create the OCI archive and manifest
46
+ # create the OCI archive
47
47
tmp_oci_archive = generate_oci_archive(args, tmpd)
48
- tmp_oci_manifest = generate_oci_manifest(args, tmpd)
48
+ # extract the OCI manifest from it. Note here that we operate
49
+ # on the ociarchive directly rather than args.srcimg because
50
+ # otherwise the manifest we fetch with skopeo *could* be a
51
+ # manifest list.
52
+ tmp_oci_manifest = generate_oci_manifest(tmp_oci_archive, tmpd)
49
53
50
54
# import into the tmp/repo to get the ostree-commit but also so it's cached
51
55
ostree_commit = import_oci_archive(tmpd, tmp_oci_archive, buildid)
@@ -87,10 +91,10 @@ def generate_oci_archive(args, tmpd):
87
91
return tmpf
88
92
89
93
90
- def generate_oci_manifest(args , tmpd):
94
+ def generate_oci_manifest(ociarchive , tmpd):
91
95
tmpf = os.path.join(tmpd, 'oci-manifest.json')
92
96
with open(tmpf, 'wb') as f:
93
- f.write(subprocess.check_output(["skopeo", "inspect", "--raw", args.srcimg ]))
97
+ f.write(subprocess.check_output(["skopeo", "inspect", "--raw", f"oci-archive:{ociarchive}" ]))
94
98
os.fchmod(f.fileno(), S_IREAD | S_IRGRP | S_IROTH)
95
99
return tmpf
96
100
0 commit comments