Skip to content

Commit b31bb26

Browse files
committed
Add Untag() to oci.Store.
Signed-off-by: Francis Laniel <[email protected]>
1 parent 79a08b4 commit b31bb26

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

content/oci/oci.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,25 @@ func (s *Store) Resolve(ctx context.Context, reference string) (ocispec.Descript
238238
return desc, nil
239239
}
240240

241+
func (s *Store) Untag(ctx context.Context, digest string) error {
242+
s.sync.RLock()
243+
defer s.sync.RUnlock()
244+
245+
if err := validateReference(digest); err != nil {
246+
return err
247+
}
248+
249+
return s.untag(digest)
250+
}
251+
252+
func (s *Store) untag(reference string) error {
253+
s.tagResolver.Untag(reference)
254+
if s.AutoSaveIndex {
255+
return s.saveIndex()
256+
}
257+
return nil
258+
}
259+
241260
// Predecessors returns the nodes directly pointing to the current node.
242261
// Predecessors returns nil without error if the node does not exists in the
243262
// store.

0 commit comments

Comments
 (0)