Skip to content

Commit 2381b85

Browse files
committed
Set org.opencontainers.image.description
Signed-off-by: Paul Hildebrandt <[email protected]>
1 parent 72a00cb commit 2381b85

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/python_gardenlinux_lib/oras/registry.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,22 @@ def get_manifest_meta_data_by_cname(
240240
and manifest_meta["annotations"]["architecture"] == arch
241241
and manifest_meta["platform"]["os.version"] == version
242242
):
243+
# Add description annotation if not present
244+
if "org.opencontainers.image.description" not in manifest_meta["annotations"]:
245+
features = manifest_meta["annotations"].get("features", "")
246+
arch = manifest_meta["annotations"]["architecture"]
247+
image_type = manifest_meta["annotations"].get("image_type", "")
248+
archive_type = manifest_meta["annotations"].get("archive_type", "")
249+
250+
description = (
251+
f"GardenLinux image {cname}-{version}-{arch}\n"
252+
f"Architecture: {arch}\n"
253+
f"Features: {features}\n"
254+
f"Image type: {image_type}\n"
255+
f"Archive type: {archive_type}"
256+
)
257+
manifest_meta["annotations"]["org.opencontainers.image.description"] = description
258+
243259
return manifest_meta
244260

245261
return None

0 commit comments

Comments
 (0)