Skip to content

Commit

Permalink
resolved some comments
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Jan 3, 2024
1 parent 2b54040 commit 73e694f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion content/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func (s *Store) GC(ctx context.Context) error {
defer s.sync.Unlock()

// clean up dangling layers in Store
danglings := s.graph.GetDanglingLayers()
danglings := s.graph.GetUnreferencedRootNodes()
for _, desc := range danglings {
// do not remove existing manifests in the index
if _, err := s.tagResolver.Resolve(ctx, string(desc.Digest)); err == errdef.ErrNotFound {
Expand Down
4 changes: 2 additions & 2 deletions internal/graph/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func (m *Memory) Exists(dgst digest.Digest) bool {
return exists

Check warning on line 183 in internal/graph/memory.go

View check run for this annotation

Codecov / codecov/patch

internal/graph/memory.go#L181-L183

Added lines #L181 - L183 were not covered by tests
}

// GetDanglingLayers returns the dangling (unreferenced) layer nodes in the memory.
func (m *Memory) GetDanglingLayers() []ocispec.Descriptor {
// GetUnreferencedRootNodes returns the dangling (unreferenced) layer nodes in the memory.
func (m *Memory) GetUnreferencedRootNodes() []ocispec.Descriptor {
var danglings []ocispec.Descriptor
for key, desc := range m.nodes {
if _, exist := m.predecessors[key]; !exist {
Expand Down

0 comments on commit 73e694f

Please sign in to comment.