oras-project / oras

OCI registry client - managing content like artifacts, images, packages
https://oras.land
Apache License 2.0
1.52k stars 181 forks source link

feat(cmd/cp): add oci-layout-path flag #1507

Closed mauriciovasquezbernal closed 1 month ago

mauriciovasquezbernal commented 2 months ago

What this PR does / why we need it:

The oci-layout can't be used when the image reference contains a slash ( see issue 1505). This PR introduces a new oci-layout-path that explicitly receives the path of the oci layout fixing the parsing ambiguity.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #1505

Please check the following list:

mauriciovasquezbernal commented 1 month ago

I updated the PR with the --from-oci-layout-path idea discussed on #1505. I'll update the documentation once we agree on this approach.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.86%. Comparing base (b6ac8e9) to head (642fcae). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1507 +/- ## ========================================== + Coverage 83.84% 83.86% +0.02% ========================================== Files 118 118 Lines 5156 5164 +8 ========================================== + Hits 4323 4331 +8 Misses 592 592 Partials 241 241 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TerryHowe commented 1 month ago

It seems like it would be easy to add a e2e test for this.

mauriciovasquezbernal commented 1 month ago

It seems like it would be easy to add a e2e test for this.

I added some tests. There is some duplication with the existing layout tests but I didn't find an easy way to avoid it.