-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: implement referrers deletion #54
Conversation
Codecov Report
@@ Coverage Diff @@
## main #54 +/- ##
==========================================
- Coverage 56.28% 56.27% -0.01%
==========================================
Files 108 108
Lines 11213 11239 +26
==========================================
+ Hits 6311 6325 +14
- Misses 4194 4202 +8
- Partials 708 712 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
registry/storage/manifeststore.go
Outdated
} | ||
|
||
// Ensure the blob is available for deletion | ||
_, err := ms.blobStore.blobAccessController.Stat(ctx, dgst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do ms.blobStore.Stat()
to get the descriptor. If the media type is not MediaTypeArtifactManifest
or MediaTypeImageManifest
, we can do ms.blobStore.Delete(ctx, dgst)
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The descriptor we get from ms.blobStore.Stat()
has an incorrect media type.
if err != nil { | ||
return fmt.Errorf("failed to generate referrers link path for %v", dgst) | ||
} | ||
if err = ms.repository.driver.Delete(ctx, referrersLinkPath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if subject
is specified but does not exist (as mentioned in #52)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the subject does not exist in the repository, the referrers feature just works as usual, which is technically conformant to the distribution spec.
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Part 2 of and Resolves #37
Basic Test result using
oras
:delete a referrer of an artifact manifest
delete a referrer of an image manifest
Signed-off-by: wangxiaoxuan273 wangxiaoxuan119@gmail.com