stages/oci-archive: support for annotations
Add support for arbitrary manifest annotations: allow anything with the exception of the `org.osbuild` and `org.opencontainer` prefixes. The former is reserved by us, the latter by the OCI image specification. The latter specifies a set of pre defined keys, which are not yet supported by osbuild but will be in the future, partly via more generic options (creation time).
This commit is contained in:
parent
2dfb6a224b
commit
65d831b2cb
1 changed files with 17 additions and 0 deletions
|
|
@ -16,6 +16,10 @@ as the `config` option for the "OCI Image Configuration" (see [2]),
|
|||
except those that map to the "Go type map[string]struct{}", which are
|
||||
represented as array of strings.
|
||||
|
||||
Manifest annotations can be included via the `annotation` options. Any
|
||||
`key`, `value` pair is allowed, with the exception of the pre-defined
|
||||
`org.osbuild` and `org.opencontainer` namespaces.
|
||||
|
||||
The final resulting tarball, aka a "orci-archive", can be imported via
|
||||
podman[3] with `podman pull oci-archive:<archive>`.
|
||||
|
||||
|
|
@ -96,6 +100,15 @@ SCHEMA_2 = r"""
|
|||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"annotations": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^(?!org.osbuild|org.opencontainer).+": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -250,6 +263,10 @@ def create_oci_dir(inputs, output_dir, options):
|
|||
"layers": []
|
||||
}
|
||||
|
||||
annotations = options.get("annotations", {})
|
||||
if annotations:
|
||||
manifest["annotations"] = annotations
|
||||
|
||||
index = {
|
||||
"schemaVersion": 2,
|
||||
"manifests": []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue