Skip to content

Commit

Permalink
final refinement before refector
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Oct 20, 2023
1 parent d5c8a61 commit 56629c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/oci/deletableoci.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@ func (ds *DeletableStore) Delete(ctx context.Context, target ocispec.Descriptor)
defer ds.lock.Unlock()

resolvers := ds.tagResolver.Map()
untagged := false
for reference, desc := range resolvers {
if content.Equal(desc, target) {
ds.tagResolver.Untag(reference)
untagged = true
}
}
if err := ds.graph.Remove(ctx, target); err != nil {
return err
}
if ds.AutoSaveIndex {
if untagged && ds.AutoSaveIndex {
err := ds.saveIndex()
if err != nil {
return err
Expand Down

0 comments on commit 56629c0

Please sign in to comment.