Skip to content

spec: Don't canonicalize containers-storage #1337

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

Merged
merged 1 commit into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl ImageReference {
// TODO maintain a proper transport enum in the spec here
let transport = Transport::try_from(self.transport.as_str())?;
match transport {
Transport::ContainerStorage | Transport::Registry => {
Transport::Registry => {
let reference: oci_spec::distribution::Reference = self.image.parse()?;

// Check if the image reference needs canonicicalization
Expand Down Expand Up @@ -350,11 +350,6 @@ mod tests {
format!("quay.io/example/someimage@{}", sample_digest),
"registry",
),
(
format!("quay.io/example/someimage:latest@{}", sample_digest),
format!("quay.io/example/someimage@{}", sample_digest),
"containers-storage",
),
// When only a digest is present, it should be used
(
format!("quay.io/example/someimage@{}", sample_digest),
Expand Down Expand Up @@ -385,7 +380,12 @@ mod tests {
format!("localhost/someimage@{sample_digest}"),
"registry",
),
// Also for now, we do not canonicalize OCI references
// Other cases are not canonicalized
(
format!("quay.io/example/someimage:latest@{}", sample_digest),
format!("quay.io/example/someimage:latest@{}", sample_digest),
"containers-storage",
),
(
format!("/path/to/dir:latest"),
format!("/path/to/dir:latest"),
Expand Down