oras icon indicating copy to clipboard operation
oras copied to clipboard

cmd/cp: Add oci-layout-path flag

Open mauriciovasquezbernal opened this issue 1 year ago • 1 comments

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:

  • [X] Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • [X] Does this change require a documentation update?
  • [ ] Does this introduce breaking changes that would require an announcement or bumping the major version?
  • [ ] Do all new files have an appropriate license header?

mauriciovasquezbernal avatar Sep 20 '24 18:09 mauriciovasquezbernal

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.

mauriciovasquezbernal avatar Oct 16 '24 16:10 mauriciovasquezbernal

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
@@            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.

codecov[bot] avatar Oct 22 '24 23:10 codecov[bot]

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

TerryHowe avatar Oct 29 '24 17:10 TerryHowe

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.

mauriciovasquezbernal avatar Oct 30 '24 14:10 mauriciovasquezbernal