]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
manifest: include metadata about the image itself
authorLuca Boccassi <bluca@debian.org>
Sun, 21 Aug 2022 20:19:09 +0000 (21:19 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 22 Aug 2022 14:07:11 +0000 (16:07 +0200)
mkosi/manifest.py

index a0d004326e2f830b8ea6da01d22a4a54902e7d16..9d32afc64afa6a715e05d4f97e01d156c3c0d313 100644 (file)
@@ -234,7 +234,22 @@ class Manifest:
         return len(self.packages) > 0
 
     def as_dict(self) -> Dict[str, Any]:
+        config = {
+            "name": self.args.image_id or "image",
+            "distribution": self.args.distribution.name,
+            "architecture": self.args.architecture,
+        }
+        if self.args.image_version is not None:
+            config["version"] = self.args.image_version
+        if self.args.release is not None:
+            config["release"] = self.args.release
+
         return {
+            # Bump this when incompatible changes are made to the manifest format.
+            "manifest_version": 1,
+            # Describe the image itself.
+            "config": config,
+            # Describe the image content in terms of packages.
             "packages": [package.as_dict() for package in self.packages],
         }