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 16, 2024
1 parent b7fb577 commit 5583a73
Show file tree
Hide file tree
Showing 6 changed files with 1,504 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/modules/ROOT/pages/ec_oci_descriptor.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
= 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:

* `mediaType` (`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 5583a73

Please sign in to comment.