Manifest and layer soft deletion.
Implement the delete API by implementing soft delete for layers and blobs by removing link files and updating the blob descriptor cache. Deletion is configurable - if it is disabled API calls will return an unsupported error. We invalidate the blob descriptor cache by changing the linkedBlobStore's blobStatter to a blobDescriptorService and naming it blobAccessController. Delete() is added throughout the relevant API to support this functionality. Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
parent
7dbe35176d
commit
390bb97a88
21 changed files with 816 additions and 92 deletions
|
@ -17,19 +17,6 @@ type revisionStore struct {
|
|||
ctx context.Context
|
||||
}
|
||||
|
||||
func newRevisionStore(ctx context.Context, repo *repository, blobStore *blobStore) *revisionStore {
|
||||
return &revisionStore{
|
||||
ctx: ctx,
|
||||
repository: repo,
|
||||
blobStore: &linkedBlobStore{
|
||||
blobStore: blobStore,
|
||||
repository: repo,
|
||||
ctx: ctx,
|
||||
linkPath: manifestRevisionLinkPath,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// get retrieves the manifest, keyed by revision digest.
|
||||
func (rs *revisionStore) get(ctx context.Context, revision digest.Digest) (*manifest.SignedManifest, error) {
|
||||
// Ensure that this revision is available in this repository.
|
||||
|
@ -118,3 +105,7 @@ func (rs *revisionStore) put(ctx context.Context, sm *manifest.SignedManifest) (
|
|||
|
||||
return revision, nil
|
||||
}
|
||||
|
||||
func (rs *revisionStore) delete(ctx context.Context, revision digest.Digest) error {
|
||||
return rs.blobStore.Delete(ctx, revision)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue