-
Notifications
You must be signed in to change notification settings - Fork 509
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
build: refactor reference parsing for oci image layouts #1456
Conversation
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.
Why the handwritten parsing and not just using the reference
library?
From the early implementation in #1173 (comment): |
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.
We should still do the validation of digest on client side. If it is a tag, we should resolve it on the client side as well.
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.
Requiring digest is very painful for the user. We should just support directory (optional tag), and find the digest on client side if possible.
77ac125
to
7d7f1a4
Compare
Have added logic for doing some basic tag resolution as well as some digest verification. Unfortunately, the hand-written parsing is still required. |
We allow any valid image reference format for the oci-layout, not just limiting to name@digest, we additionally allow images of the form name:tag@digest now. The name of the reference is used to find the local directory to lookup the store in, while the tag and digest are attached to a random identity to generate the dummy reference sent to the oci-layout context. This separation of the target to replace and the value to replace it with ensures that any tag or digest set in the client is properly sent across to the server. The tag is used when a digest was not specified, and it is resolved in the context of the local directory before being sent, using the same helpers as we use for the local cache expoter. Signed-off-by: Justin Chadwell <me@jedevc.com>
7d7f1a4
to
70682b0
Compare
cc @deitch (thought you might be interested in this one) |
Thanks for cc'ing me @jedevc . I am interested. I always have to remind myself of the current behaviour, just to evaluate what this does. 😁 The prior was This changes it to also support Based on the code, it looks like any form will work, e.g. I have seen many that "override" the |
Should we add some examples to the docs/README for it? |
Signed-off-by: Justin Chadwell <me@jedevc.com>
Ah, yup, have updated the reference docs for it no, to explain the new tags behavior 👍 It's a lot neater now that we don't have to explain about requiring a digest in the name 🎉 |
⬆️ Follow up to #1173.
We allow any valid image reference format for the oci-layout, not just limiting to name@digest, we additionally allow images of the form name:tag@digest now.
The name of the reference is used to find the local directory to lookup the store in, while the tag and digest are attached to a random identity to generate the dummy reference sent to the oci-layout context.
This separation of the target to replace and the value to replace it with ensures that any tag or digest set in the client is properly sent across to the server. The tag, while not relevant now, may become relevant at some point in the future for the server, so we can should send it across for now.