Skip to content

Commit

Permalink
removed a function as it's no longer relevant
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Oct 16, 2023
1 parent 0e6f960 commit 645c47a
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions content/oci/deletableoci.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (ds *DeletableStore) loadIndexFile(ctx context.Context) error {
return fmt.Errorf("failed to decode index file: %w", err)
}
ds.index = &index
return loadIndexIntoMemory(ctx, ds.index, ds.storage, ds.tagResolver, ds.graph)
return loadIndex(ctx, ds.index, ds.storage, ds.tagResolver, ds.graph)
}

// SaveIndex writes the `index.json` file to the file system.
Expand Down Expand Up @@ -334,22 +334,3 @@ func (ds *DeletableStore) writeIndexFile() error {
}
return os.WriteFile(ds.indexPath, indexJSON, 0666)
}

// loadIndexIntoMemory loads index into the memory.
func loadIndexIntoMemory(ctx context.Context, index *ocispec.Index, fetcher content.Fetcher, tagger content.Tagger, graph *graph.Memory) error {
for _, desc := range index.Manifests {
if err := tagger.Tag(ctx, deleteAnnotationRefName(desc), desc.Digest.String()); err != nil {
return err
}
if ref := desc.Annotations[ocispec.AnnotationRefName]; ref != "" {
if err := tagger.Tag(ctx, desc, ref); err != nil {
return err
}
}
plain := descriptor.Plain(desc)
if err := graph.IndexAll(ctx, fetcher, plain); err != nil {
return err
}
}
return nil
}

0 comments on commit 645c47a

Please sign in to comment.