Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cp: Fix --from-oci-layout when using full reference
Copying an image from an OCI layout with a value like "foo/bar:latest" for "org.opencontainers.image.ref.name" was failing with: ``` $ oras cp --from-oci-layout ./myimage:foo/bar:latest localhost:5000/foo:latest Error: invalid argument "./myimage:foo/bar:latest": failed to find path "./myimage:foo/bar:": stat /myimage:foo/bar: no such file or directory ``` According to [0], foo/bar:latest if a valid value for "org.opencontainers.image.ref.name", so the command should work. This commit fixes that by using strings.Index() instead of strings.LastIndex(). [0]: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc5/annotations.md Signed-off-by: Mauricio Vásquez <mauriciov@microsoft.com>
- Loading branch information