spec: Note we don't canonicalize oci #1311
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous code in trying to parse
oci
was wrong; the syntax for anoci
transport is the same as oci-archive, which includes a file path (and there's no mechanism to quote:
note).The canonical logic for all of this stuff is in Go, there's no canonical Rust library (yet, though I did think about putting this in oci-spec).
Previous to this attempt to handle tagged+digested, we weren't parsing image references at all.
First, factor out a
canonicalize_reference
helper since that's what we're really doing here, it's independent of the transport.Fix the canonicalize function to drop out trying to parse
oci
.Add a separate test case that incorrectly passes just so it's a bit more obvious to fix this later.
Note that today at least
skopeo
rejects trying to fetch via tagged+digested form from anoci:
so it's fine if we don't canonicalize here yet, even though it could confuse someone.