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

oci.Storage.Delete() should return ErrNotFound if target is not present in the storage #626

Closed
Wwwsylvia opened this issue Oct 23, 2023 · 1 comment · Fixed by #627
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Wwwsylvia
Copy link
Member

In the current implementation, a *PathError will be return if target is not present in the storage, which is not user-friendly.

// Delete removes the target from the system.
func (s *Storage) Delete(ctx context.Context, target ocispec.Descriptor) error {
path, err := blobPath(target.Digest)
if err != nil {
return fmt.Errorf("%s: %s: %w", target.Digest, target.MediaType, errdef.ErrInvalidDigest)
}
targetPath := filepath.Join(s.root, path)
return os.Remove(targetPath)
}

@Wwwsylvia Wwwsylvia added this to the v2.4.0 milestone Oct 23, 2023
@wangxiaoxuan273
Copy link
Contributor

I'd like to work on this.

@shizhMSFT shizhMSFT added the bug Something isn't working label Oct 24, 2023
Wwwsylvia pushed a commit that referenced this issue Oct 25, 2023
resolves #626
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants