Skip to content

Commit

Permalink
Enable the fetching of only the OCI descriptor
Browse files Browse the repository at this point in the history
Some OCI artifacts need to have a specific media type (i.e. they should
only be an OCI image index or an OCI image manifest). In order to
determine that with a single remote call, we can just get the descriptor
and then check the mediaType of that object.

Signed-off-by: arewm <arewm@users.noreply.github.com>
  • Loading branch information
arewm committed Dec 20, 2024
1 parent b881251 commit 88ce5a8
Show file tree
Hide file tree
Showing 6 changed files with 593 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/modules/ROOT/pages/ec_oci_descriptor.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
= ec.oci.descriptor

Fetch a raw Image from an OCI registry.

== Usage

object = ec.oci.descriptor(ref: string)

== Parameters

* `ref` (`string`): OCI descriptor reference

== Return

`object` (`object`): the OCI descriptor object

The object contains the following attributes:

* `annotations` (`object`)
** (`string`): (`string`)
* `artifactType` (`string`)
* `data` (`string`)
* `digest` (`string`)
* `mediaType` (`string`)
* `platform` (`object`)
** `architecture` (`string`)
** `features`(`array`)
*** (`string`)
** `os` (`string`)
** `os.features`(`array`)
*** (`string`)
** `os.version` (`string`)
** `variant` (`string`)
* `size` (`number`)
* `urls`(`array`)
** (`string`)
2 changes: 2 additions & 0 deletions docs/modules/ROOT/pages/rego_builtins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ information.
|===
|xref:ec_oci_blob.adoc[ec.oci.blob]
|Fetch a blob from an OCI registry.
|xref:ec_oci_descriptor.adoc[ec.oci.descriptor]
|Fetch a raw Image from an OCI registry.
|xref:ec_oci_image_files.adoc[ec.oci.image_files]
|Fetch structured files (YAML or JSON) from within an image.
|xref:ec_oci_image_manifest.adoc[ec.oci.image_manifest]
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/partials/rego_nav.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* xref:rego_builtins.adoc[Rego Reference]
** xref:ec_oci_blob.adoc[ec.oci.blob]
** xref:ec_oci_descriptor.adoc[ec.oci.descriptor]
** xref:ec_oci_image_files.adoc[ec.oci.image_files]
** xref:ec_oci_image_manifest.adoc[ec.oci.image_manifest]
** xref:ec_purl_is_valid.adoc[ec.purl.is_valid]
Expand Down
Loading

0 comments on commit 88ce5a8

Please sign in to comment.