Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support OCI Image Layout Specification #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ae-govau
Copy link

This adds "oci-layout" as a format during "get" which saves out the contents per the OCI Image Layout Specification.

It also fixes the corresponding "put" to upload all images (including multi-architecture images) that are written according to this specification.

This handles both modern image indexes, as well as legacy image references.

Amongst other things, this makes this resource type more suitable for mirroring images from one repo to another, as this now will (a) preserve the digest and (b) mirror all images for each architecture in the source image.

This adds "oci-layout" as a format during "get" which saves out the
contents per the OCI Image Layout Specification.

It also fixes the corresponding "put" to upload all images (including
multi-architecture images) that are written according to this
specification.

This handles both modern image indexes, as well as legacy image
references.

Amongst other things, this makes this resource type more suitable for
mirroring images from one repo to another, as this now will (a) preserve
the digest and (b) mirror all images for each architecture in the source
image.

Signed-off-by: Adam Eijdenberg <[email protected]>
@ae-govau
Copy link
Author

The current output format of oci doesn't actually correspond to any published OCI Specification that I can find. However for this PR I added a 3rd output format oci-layout for get which does match the OCI Image Layout Specification.

While this should result in no changes to get (unless opted into with format: oci-layout), this PR does change the (currenlyt undocumented) behaviour of put when it refers to a directory.

Previously it would recognise an image in the oci-layout format, and would try to push it, but would fail if more than one image was present (such as multi-archictecture builds). With this change it should now succeed. Also previously it would confusing pick an odd digest for the image (it would find the first child manifest and use that, rather than the parent) - now it will correctly put the same digest that it previously gets. This PR also (if content trust is enabled) tries to submit each image found. I'm not sure if that is the best outcome, but I couldn't see a library method that would accept an ImageIndex so that seemed simplest.

I can see a build failure in this PR, however I'm unable to sign into your Concourse to check the build status to see why - tests did pass locally (including ones that push to repos) before submitting, however I didn't run the private repo tests.

@ae-govau
Copy link
Author

Looks like tests have passed now. Perhaps someone re-ran them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

1 participant