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

Add support for layer extraction from OCI artifacts with ImageIndex #1369

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

errordeveloper
Copy link
Contributor

@errordeveloper errordeveloper commented Feb 8, 2024

This change makes fetching of OCI artifacts compatible with a wider range of images, namely where the top-level object is an index. Once the index is fetched, the media type selector and (optionally) a numeric offset will be applied to determine what blob to use.

Towards #1247.

Signed-off-by: Ilya Dmitrichenko <[email protected]>
Signed-off-by: Ilya Dmitrichenko <[email protected]>
Signed-off-by: Ilya Dmitrichenko <[email protected]>
Comment on lines +187 to +189
// TODO: next API version should probably use artifact media types
// at the top level and make layer selector optional
ArtifactMediaType string `json:"artifactMediaType,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this used anywhere in the controller logic, can you explain what's the role of this field? Is this something that's in the latest OCI spec but not implemented by any registry yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a quick rebase of a WIP branch that I had from around the time of #1244. I thought I should open a draft PR before it's forgotten. It still needs some tidying for sure. This field looks like an idea I had at the time, I'll refresh my memory and see if this needs implementing or deleting.

Copy link
Contributor Author

@errordeveloper errordeveloper Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have recapped this. The idea is actaully that media type of artifact index and the layers that it points at are two distinct notions. I should probably try implementing the field in this PR, without flipping API semanitcs until there is more to make a case for API version bump.
The point is that what you want to select primarily is the media type of the OCI index, the type of the blob is a secondary concern, it can be defaulted to a tarball.

@errordeveloper errordeveloper force-pushed the fetch-oci-index branch 2 times, most recently from 30531f4 to 72f92ac Compare February 9, 2024 15:02
Signed-off-by: Ilya Dmitrichenko <[email protected]>
@stefanprodan stefanprodan changed the title Fetch OCI index Add support for layer extraction from OCI artifacts with ImageIndex Mar 4, 2024
@stefanprodan stefanprodan added enhancement New feature or request area/oci OCI related issues and pull requests labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci OCI related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants