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

be more explicit about multiple image references for oci #1416

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

Conversation

lsm5
Copy link
Member

@lsm5 lsm5 commented Nov 23, 2021

Signed-off-by: Lokesh Mandvekar lsm5@fedoraproject.org

@mtrmac @vrothberg @rhatdan PTAL.

RE: containers/skopeo#1513

[CI:DOCS]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
@lsm5
Copy link
Member Author

lsm5 commented Nov 23, 2021

does [CI:DOCS] need to be in the commit title? I added it to the commit message body, but it's still going through CI.

@@ -60,7 +60,7 @@ The _algo:digest_ refers to the image ID reported by docker-inspect(1).
### **oci:**_path[:reference]_

An image compliant with the "Open Container Image Layout Specification" at _path_.
Using a _reference_ is optional and allows for storing multiple images at the same _path_.
Using a _reference_ is optional for a single image reference but required for storing multiple images at the same _path_.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not quite precise. It’s accessing an image from a multi-image archive that requires providing a disambiguating name; the code will happily enough add (untagged/unnamed) images to an archive, as the motivating bug report demonstrates.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mtrmac would you prefer an additional sentence and/or an example in the docs for clarifying the github issue case? Something like pulling multiple images without specification of reference will not preserve all references ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

pulling multiple images without specification of reference will not preserve all references ?

I’m not quite sure what that means. (It’s a general principle of skopeo copy that names used in the source reference don’t affect names in the destination reference; it’s not something specific to this transport. So, copies by skopeo copy never “preserve” names/references in that sense — OTOH Podman does have various heuristics of that kind.)


The general kinds information we probably want to convey for the two transports:

  • (Maybe: The reference value corresponds to the org.opencontainers.image.ref.name annotation.)
  • When reading images from oci: or oci-archive:, if path contains multiple images, a reference must be specified to disambiguate; otherwise, the only image is implied.
  • When writing images, reference is optional and set on the written image [to allow disambiguating reads]
  • Repeated image writes to oci: don’t overwrite pre-existing images, whether or not reference is provided (but every reference will only point to one image).
  • Repeated image writes to oci-archive: overwrite the whole archive; only one image, the last written one, is included. (Do we want to guarantee that? Probably, ambiguity doesn’t help anyone, but I’m not 100% sure.)

(Warning: I didn’t actually test any of this right now, just reading the code.)

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Dec 7, 2022
@mtrmac
Copy link
Collaborator

mtrmac commented Nov 27, 2023

The core of this PR has since been documented by #2042 ; #1416 (comment) contains a few more items that might be worth highlighting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants