diff --git a/src/python_gardenlinux_lib/features/parse_features.py b/src/python_gardenlinux_lib/features/parse_features.py index be1ab278..5c6239cc 100644 --- a/src/python_gardenlinux_lib/features/parse_features.py +++ b/src/python_gardenlinux_lib/features/parse_features.py @@ -35,6 +35,7 @@ "vhd.log", "ova.log", "raw.log", + "oci.log", "initrd", "tar.gz", "qcow2", @@ -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", } diff --git a/src/python_gardenlinux_lib/oras/registry.py b/src/python_gardenlinux_lib/oras/registry.py index c624af56..ecf355f4 100644 --- a/src/python_gardenlinux_lib/oras/registry.py +++ b/src/python_gardenlinux_lib/oras/registry.py @@ -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 diff --git a/src/python_gardenlinux_lib/oras/schemas.py b/src/python_gardenlinux_lib/oras/schemas.py index 6f2d2d6a..51626e17 100644 --- a/src/python_gardenlinux_lib/oras/schemas.py +++ b/src/python_gardenlinux_lib/oras/schemas.py @@ -56,5 +56,4 @@ "schemaVersion": 2, "mediaType": "application/vnd.oci.image.index.v1+json", "manifests": [], - "annotations": {}, }