As part of the implementation of the export to OCI Layout feature we required to translate an image reference and map it to a path in the local filesystem. This operation is useful for Lifecycle implementors but also for Platform implementors, that's why the best place to offer this utility method is on imgUtil repository.
Expected behavior
Considering an image reference refers to either a tag reference or digest reference. It has the following formats
A tag reference refers to an identifier of form <registry>/<repo>:<tag>
A digest reference refers to a content addressable identifier of form <registry>/<repo>@<algorithm>:<digest>
Expose a method like:
classDiagram
class layout {
ParseRefToPath(imageRef string) (string, error)
}
This method parses the given image reference to local path directory following the rules:
WHEN the image reference points to a tag reference returns <registry>/<repo>/<tag>
WHEN the image reference points to a digest reference returns <registry>/<repo>/<algorithm>/<digest>
Reason
As part of the implementation of the export to OCI Layout feature we required to translate an image reference and map it to a path in the local filesystem. This operation is useful for Lifecycle implementors but also for Platform implementors, that's why the best place to offer this utility method is on imgUtil repository.
Expected behavior
Considering an image reference refers to either a tag reference or digest reference. It has the following formats
<registry>/<repo>:<tag>
<registry>/<repo>@<algorithm>:<digest>
Expose a method like:
This method parses the given image reference to local path directory following the rules:
<registry>/<repo>/<tag>
<registry>/<repo>/<algorithm>/<digest>
Related
See issue 152 for more context