Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/python_gardenlinux_lib/features/parse_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"vhd.log",
"ova.log",
"raw.log",
"oci.log",
"initrd",
"tar.gz",
"qcow2",
Expand Down Expand Up @@ -85,6 +86,7 @@
"platform.test.xml": "application/io.gardenlinux.io.platform.test.xml",
"chroot.test.log": "application/io.gardenlinux.io.chroot.test.log",
"chroot.test.xml": "application/io.gardenlinux.io.chroot.test.xml",
"oci.log": "application/io.gardenlinux.log",
}


Expand Down
34 changes: 13 additions & 21 deletions src/python_gardenlinux_lib/oras/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,27 +228,19 @@ def get_manifest_meta_data_by_cname(
return None

for manifest_meta in index["manifests"]:
if "annotations" not in manifest_meta:
logger.debug("Manifest annotations was none, which is invalid")
return None

if "cname" not in manifest_meta["annotations"]:
logger.debug("cname annotation was none, which is invalid")
return None

if "architecture" not in manifest_meta["annotations"]:
logger.debug("architecture annotation was none, which is invalid")
return None

if "platform" not in manifest_meta:
logger.debug("platform data was none, which is invalid")
return None
if (
manifest_meta["annotations"]["cname"] == cname
and manifest_meta["annotations"]["architecture"] == arch
and manifest_meta["platform"]["os.version"] == version
):
return manifest_meta
# Annotations are optional:
# https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md#properties

if "annotations" in manifest_meta:
if (
"cname" in manifest_meta["annotations"]
and "architecture" in manifest_meta["annotations"]
and "os.version" in manifest_meta["platform"]
and manifest_meta["annotations"]["cname"] == cname
and manifest_meta["annotations"]["architecture"] == arch
and manifest_meta["platform"]["os.version"] == version
):
return manifest_meta

return None

Expand Down
1 change: 0 additions & 1 deletion src/python_gardenlinux_lib/oras/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [],
"annotations": {},
}