Skip to content

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

@qweeah

Description

@qweeah

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions