-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Split OCI Image Index from Docker Manifest List #3869
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
Conversation
9ef6b51
to
4cee737
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #3869 +/- ##
==========================================
+ Coverage 56.58% 57.11% +0.53%
==========================================
Files 105 108 +3
Lines 10636 10759 +123
==========================================
+ Hits 6018 6145 +127
+ Misses 3946 3940 -6
- Partials 672 674 +2
☔ View full report in Codecov by Sentry. |
Move implementation of the index from the manifestlist package to the ocischema package so that other modules making empty imports support the manifest types their authors would expect. This is a breaking change to distribution as a library but not the registry. As OCI 1.0 released the manifest and index together, that is a good package from which to initialise both manifests. The docker manifest and manifest list remain in separate packages because one was released later. The image index and manifest list still share common code in many functions not intended for import by other modules. Signed-off-by: Bracken Dawson <abdawson@gmail.com>
4cee737
to
e72294d
Compare
Empty platform structs were already supported after splitting OCI Image Index out from Docker Manifest List. Signed-off-by: Bracken Dawson <abdawson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I need to give it another pass due to the volume of this change but on the first pass this LGTM. I have a few comments and suggestions but none of them is related to the core logic -- they're mostly just nits.
// OCISchemaVersion provides a pre-initialized version structure for this | ||
// packages OCIschema version of the manifest. | ||
var OCISchemaVersion = manifest.Versioned{ | ||
SchemaVersion: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as earlier. Feel free to ignore me, but I figured it might be worth changing it as we use this const value in a few places in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using this definition as the source of truth for the other uses in the Index. I know it's not const because it's a struct, I can isolate it further to a read const if you like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
@thaJeztah do you want to give this a pass, too, please? In case I missed something, which I'm pretty sure I did 😄 |
Yes, I can give this one a pass; currently hanging out at KubeCon and was looking at it from my phone (bit hard to read the diff 😆). I recall I looked at some of this, and seem to remember some "docker" types could potentially be just aliases for the OCI types if we get rid of this mostly useless "Describable" interface; Line 73 in 0c95801
Which was implemented in various places "for convenience" Line 91 in 0c95801
(I may have a branch that gets rid of that) |
- DRY out SchemaVersion literals - Better name the predefined Versioned struct for the Image Index - Var names, declarations, else cases. Co-authored-by: Milos Gajdos <milosthegajdos@gmail.com> Signed-off-by: Bracken Dawson <abdawson@gmail.com>
It is desirable to remove Platform from distribution.Descriptor because it doesn't really belong there. However this would be a further breaking change because the References() call would no longer be returning plaform information when it reurns descriptors of manifests, which is started to for OCI Indices after c94f288 and this feature was added to Docker Manifest Lists in 1a059fe. I don't want to take away something people clearly want. Signed-off-by: Bracken Dawson <abdawson@gmail.com>
@milosgajdos @thaJeztah while working on implementing the referrers api for #3716 I found that the current shared manifestlist type can't be used for the referrers API response because the |
This approach is fine with me. I'm waiting for @thaJeztah and @squizzi to have a look. |
ping @wy65701436 |
Ping @deleteriousEffect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Move implementation of the index from the manifestlist package to the ocischema package so that other modules making empty imports support the manifest types their authors would expect. This is a breaking change to distribution as a library but not the registry.
As OCI 1.0 released the manifest and index together, that is a good package from which to initialise both manifests. The docker manifest and manifest list remain in separate packages because one was released later.
The image index and manifest list still share common code in many functions not intended for import by other modules.
This now supports (omits) empty platform objects in OCI Image Indices.
This adds support for annotations on OCI Image Indices.
fixes #3836
fixes #2652