Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qweeah opened this issue Nov 7, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Nov 7, 2023

oci.NewFromTar can be used to create a new read-only OCI store from a tarfile path. If the passed-in path doesn't point to a tarfile, currently(v2.3.1) below errors will be returned:

  • If the length of the file is zero, a failed to open OCI layout file: oci-layout: file does not exist error will be returned
  • If the length of the file is not zero, an io.ErrUnexpectedEOF will be returned

As a user of oras-go SDK, I would like this function to return a unified and exported error type. Also, the error should indicate that the passed-in path doesn't point to an expected tarfile.

@yizha1 yizha1 added enhancement New feature or request good first issue Good for newcomers labels Nov 7, 2023
@yizha1 yizha1 added this to the future milestone Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants