Skip to content

fix: add missing operation to fs path error#799

Merged
Wwwsylvia merged 2 commits into
oras-project:mainfrom
qweeah:layout-error
Jul 30, 2024
Merged

fix: add missing operation to fs path error#799
Wwwsylvia merged 2 commits into
oras-project:mainfrom
qweeah:layout-error

Conversation

@qweeah

@qweeah qweeah commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

When opening a folder as OCI image layout and there is no oci-layout file exists, the error would be

failed to open OCI layout file: oci-layout: file does not exist

There is a duplicated space in the error string, because the Op field is missing in the returned fs.PathError. With fix in this PR, the return error would be

failed to open OCI layout file: open oci-layout: file does not exist

Fixes #640

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov

codecov Bot commented Jul 25, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.88%. Comparing base (c8c2048) to head (f3a6d39).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
- Coverage   77.92%   77.88%   -0.05%     
==========================================
  Files          63       63              
  Lines        4694     4694              
==========================================
- Hits         3658     3656       -2     
- Misses        656      657       +1     
- Partials      380      381       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread internal/fs/tarfs/tarfs.go Outdated
Comment thread internal/fs/tarfs/tarfs.go Outdated
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@Wwwsylvia Wwwsylvia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Wwwsylvia
Wwwsylvia merged commit bacf8f0 into oras-project:main Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve the returned error of oci.NewFromTar when the passed-in path is not a tarfile

3 participants