1010
1111from oras .defaults import default_manifest_media_type as IMAGE_MANIFEST_MEDIA_TYPE
1212
13- from ..constants import GL_DISTRIBUTION_NAME , GL_REPOSITORY_URL
13+ from ..constants import (
14+ GL_DISTRIBUTION_NAME ,
15+ GL_RELEASE_ID ,
16+ GL_REPOSITORY_URL ,
17+ GL_VENDOR_NAME ,
18+ )
1419from ..features import ArtifactBaseName , Flavor
1520from .layer import Layer
1621from .manifest import Manifest
@@ -45,9 +50,13 @@ class ImageManifest(Manifest):
4550 """
4651 OCI image manifest Garden Linux canonical name deprecated annotation
4752 """
53+ ANNOTATION_OS_ID_KEY = "io.gardenlinux.image.os-id"
54+ """
55+ OCI image manifest Garden Linux operating system annotation
56+ """
4857 ANNOTATION_COMMIT_KEY = "org.opencontainers.image.revision"
4958 """
50- OCI image manifest GardenLinux commit hash annotation
59+ OCI image manifest commit hash annotation
5160 """
5261 ANNOTATION_FEATURE_SET_KEY = "io.gardenlinux.image.feature-set"
5362 """
@@ -59,11 +68,15 @@ class ImageManifest(Manifest):
5968 """
6069 ANNOTATION_SOURCE_REPO_KEY = "org.opencontainers.image.source"
6170 """
62- OCI image manifest Garden Linux source repository URL annotation
71+ OCI image manifest source repository URL annotation
72+ """
73+ ANNOTATION_VENDOR_KEY = "org.opencontainers.image.vendor"
74+ """
75+ OCI image manifest vendor annotation
6376 """
6477 ANNOTATION_VERSION_KEY = "org.opencontainers.image.version"
6578 """
66- OCI image manifest GardenLinux version annotation
79+ OCI image manifest version annotation
6780 """
6881 IMAGE_MANIFEST_MEDIA_TYPE = IMAGE_MANIFEST_MEDIA_TYPE
6982 """
@@ -242,39 +255,52 @@ def extended_dict(self) -> Dict[str, Any]:
242255
243256 manifest_description = manifest_annotations [ImageManifest .ANNOTATION_TITLE_KEY ]
244257
245- if ImageManifest .ANNOTATION_ARCH_KEY in manifest_annotations :
258+ annotation_arch_key = ImageManifest .ANNOTATION_ARCH_KEY
259+ annotation_commit_key = ImageManifest .ANNOTATION_COMMIT_KEY
260+ annotation_version_key = ImageManifest .ANNOTATION_VERSION_KEY
261+
262+ if annotation_arch_key in manifest_annotations :
246263 manifest_description += f" ({ self .arch } )"
247264
248265 if ImageManifest .ANNOTATION_SOURCE_REPO_KEY not in manifest_annotations :
249266 manifest_annotations [ImageManifest .ANNOTATION_SOURCE_REPO_KEY ] = (
250267 GL_REPOSITORY_URL
251268 )
252269
253- if ImageManifest . ANNOTATION_VERSION_KEY in manifest_annotations :
270+ if annotation_version_key in manifest_annotations :
254271 manifest_annotations [Manifest .ANNOTATION_VERSION_DEPRECATED_KEY ] = (
255272 self .version
256273 )
257274 manifest_description += " " + self .version
258275
259- if ImageManifest . ANNOTATION_COMMIT_KEY in manifest_annotations :
276+ if annotation_commit_key in manifest_annotations :
260277 manifest_annotations [Manifest .ANNOTATION_COMMIT_DEPRECATED_KEY ] = (
261278 self .commit
262279 )
263280 manifest_description += f" ({ self .commit_id } )"
264281
265282 if (
266283 ImageManifest .ANNOTATION_CNAME_KEY in manifest_annotations
267- and ImageManifest . ANNOTATION_ARCH_KEY in manifest_annotations
268- and ImageManifest . ANNOTATION_VERSION_KEY in manifest_annotations
269- and ImageManifest . ANNOTATION_COMMIT_KEY in manifest_annotations
284+ and annotation_arch_key in manifest_annotations
285+ and annotation_version_key in manifest_annotations
286+ and annotation_commit_key in manifest_annotations
270287 ):
271288 manifest_annotations [ImageManifest .ANNOTATION_ARTIFACT_BASE_NAME_KEY ] = (
272289 self .artifact_base_name
273290 )
291+
274292 manifest_annotations [ImageManifest .ANNOTATION_CNAME_DEPRECATED_KEY ] = (
275293 self .artifact_base_name
276294 )
277295
296+ if ImageManifest .ANNOTATION_OS_ID_KEY not in manifest_annotations :
297+ manifest_annotations [ImageManifest .ANNOTATION_OS_ID_KEY ] = GL_RELEASE_ID
298+
299+ annotation_vendor_key = ImageManifest .ANNOTATION_VENDOR_KEY
300+
301+ if annotation_vendor_key not in manifest_annotations :
302+ manifest_annotations [annotation_vendor_key ] = GL_VENDOR_NAME
303+
278304 if ImageManifest .ANNOTATION_FEATURE_SET_KEY in manifest_annotations :
279305 manifest_description += (
280306 " - " + manifest_annotations [ImageManifest .ANNOTATION_FEATURE_SET_KEY ]
@@ -285,7 +311,7 @@ def extended_dict(self) -> Dict[str, Any]:
285311 manifest_description
286312 )
287313
288- if ImageManifest . ANNOTATION_ARCH_KEY in manifest_annotations :
314+ if annotation_arch_key in manifest_annotations :
289315 # @TODO: Deprectated annotation
290316 manifest_annotations ["architecture" ] = self .arch
291317
@@ -317,7 +343,7 @@ def layers_as_dict(self) -> Dict[str, Any]:
317343
318344 return layers
319345
320- def append_layer (self , layer : Layer | Dict [str , Any ]) -> None :
346+ def add_layer (self , layer : Layer | Dict [str , Any ]) -> None :
321347 """
322348 Appends the given OCI image manifest layer to the manifest
323349
0 commit comments