From 12dcf3c6d97ffb53600a4ff6973f37ff741e34f9 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Thu, 10 Oct 2024 18:21:54 +0200 Subject: [PATCH] schema: `metadata` at the top level Allows a new object under the top-level key `metadata` which contains a `generators` property. This property is a list of all generators involved in the creation of a manifest. Each generator can add its name and version to this list. Signed-off-by: Simon de Vlieger --- schemas/osbuild2.json | 28 ++++++++++++++++++++++++ test/data/manifests/fedora-boot.json | 8 +++++++ test/data/manifests/fedora-boot.mpp.yaml | 4 ++++ 3 files changed, 40 insertions(+) diff --git a/schemas/osbuild2.json b/schemas/osbuild2.json index faf7804d..00d4e2ed 100644 --- a/schemas/osbuild2.json +++ b/schemas/osbuild2.json @@ -19,6 +19,9 @@ "enum": [ "2" ] + }, + "metadata": { + "$ref": "#/definitions/metadata" } }, "definitions": { @@ -83,6 +86,31 @@ } } }, + "metadata": { + "title": "Metadata information for a manifest", + "type": "object", + "additionalProperties": false, + "properties": { + "generators": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + } + } + } + } + }, "mounts": { "title": "Collection of mount points for a stage", "type": "array", diff --git a/test/data/manifests/fedora-boot.json b/test/data/manifests/fedora-boot.json index 96b3403c..149327a6 100644 --- a/test/data/manifests/fedora-boot.json +++ b/test/data/manifests/fedora-boot.json @@ -1,5 +1,13 @@ { "version": "2", + "metadata": { + "generators": [ + { + "name": "osbuild-mpp", + "version": "unknown" + } + ] + }, "pipelines": [ { "runner": "org.osbuild.fedora39", diff --git a/test/data/manifests/fedora-boot.mpp.yaml b/test/data/manifests/fedora-boot.mpp.yaml index 9abc62c0..f8e5dda1 100644 --- a/test/data/manifests/fedora-boot.mpp.yaml +++ b/test/data/manifests/fedora-boot.mpp.yaml @@ -2,6 +2,10 @@ # Noticed the org.osbuild.test that was added. version: '2' +metadata: + generators: + - name: osbuild-mpp + version: unknown pipelines: - mpp-import-pipelines: path: fedora-vars.ipp.yaml