Skip to content

Commit

Permalink
Add Untag() to oci.Store.
Browse files Browse the repository at this point in the history
Signed-off-by: Francis Laniel <[email protected]>
  • Loading branch information
eiffel-fl committed Dec 4, 2023
1 parent 79a08b4 commit b31bb26
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions content/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,25 @@ func (s *Store) Resolve(ctx context.Context, reference string) (ocispec.Descript
return desc, nil
}

func (s *Store) Untag(ctx context.Context, digest string) error {
s.sync.RLock()
defer s.sync.RUnlock()

if err := validateReference(digest); err != nil {
return err
}

return s.untag(digest)
}

func (s *Store) untag(reference string) error {
s.tagResolver.Untag(reference)
if s.AutoSaveIndex {
return s.saveIndex()
}
return nil
}

// Predecessors returns the nodes directly pointing to the current node.
// Predecessors returns nil without error if the node does not exists in the
// store.
Expand Down

0 comments on commit b31bb26

Please sign in to comment.