-
Notifications
You must be signed in to change notification settings - Fork 544
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
Implement OCI Image Layout support #261
Conversation
e41f077
to
182d516
Compare
77f1236
to
51e85d2
Compare
Codecov Report
@@ Coverage Diff @@
## master #261 +/- ##
=========================================
+ Coverage 52.36% 53.6% +1.23%
=========================================
Files 78 85 +7
Lines 3739 4022 +283
=========================================
+ Hits 1958 2156 +198
- Misses 1486 1531 +45
- Partials 295 335 +40
Continue to review full report at Codecov.
|
b3d4a1d
to
0ceea1b
Compare
1c1db73
to
5ca6303
Compare
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.
Lookin' good so far! 🎉
...testdata/test_image/555b1001d54ed229f56990845856f080b0707348b26b3aa85aaf58d5570cdee0/VERSION
Outdated
Show resolved
Hide resolved
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.
A couple of general questions on the pkg/v1/layout
API. It looks sufficient at a detailed level - I'd just like to understand the general approach better and whether it could be framed a bit more cleanly.
aa33562
to
fc729a5
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
@jonjohnsonjr I confirm I'm ok with my commits being contributed to this project. |
This probably isn't something we want to ship, but just as an example for using the library.
e066410
to
bfe04fc
Compare
@imjasonh I think this if RFAL. |
bfe04fc
to
0fb28bb
Compare
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.
My previous concerns have been addressed, thanks.
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 change looks okay to me, but I'd love to get some eyes on it belonging to someone more familiar with OCI image layouts. @vbatts perhaps?
Primarily, drop Layout from most structs to avoid the stutter, e.g. layout.LayoutPath -> layout.Path layout.LayoutOption -> layout.Option
@glyn I renamed a few things to satisfy the go linter, hope that's alright with you. |
Ref #255
Feedback welcome :)
what changes
layout.Write
takes an ImageIndex and writes it to disk as an OCI Image Layout. This writes the top-level manifest as index.json.layout.Read
returns aLayoutPath
for the given path. You use this as the entrypoint into reading from a layout.LayoutPath.Append{Image,Index}
writes an image or index to the image layout and updates the index.json.LayoutPath.WriteBlob
writes a blob to the OCI Image Layout, but doesn't update the index.json.LayoutPath.AppendDescriptor
adds a descriptor to the index.json. This + WriteBlob lets you store arbitrary stuff in the image layout.LayoutPath.Image
reads a specific image by digest from the image layout.LayoutPath.ImageIndex
reads the whole image layout as and image index.how do you use it?
You can construct arbitrary layouts via
WriteBlob
andAppendDescriptor
. I think we'll want to make this a bit more ergonomic, e.g.Append{Image,Index}
are going to be common operations, probably, since they just write an artifact to the blobs/ directory and update theindex.json
. There are some options, e.g.WithURLs
andWithAnnotations
to make it easier to Append things with the right descriptor.