MCPcopy
hub / github.com/aquasecurity/trivy / MissingBlobs

Method MissingBlobs

pkg/cache/remote.go:70–78  ·  view source on GitHub ↗

MissingBlobs fetches missing blobs from RemoteCache

(ctx context.Context, imageID string, layerIDs []string)

Source from the content-addressed store, hash-verified

68
69// MissingBlobs fetches missing blobs from RemoteCache
70func (c RemoteCache) MissingBlobs(ctx context.Context, imageID string, layerIDs []string) (bool, []string, error) {
71 layers, err := rpc.Retry(ctx, func() (*rpcCache.MissingBlobsResponse, error) {
72 return c.client.MissingBlobs(c.ctx, rpc.ConvertToMissingBlobsRequest(imageID, layerIDs))
73 })
74 if err != nil {
75 return false, nil, xerrors.Errorf("unable to fetch missing layers: %w", err)
76 }
77 return layers.MissingArtifact, layers.MissingBlobIds, nil
78}
79
80// DeleteBlobs removes blobs by IDs from RemoteCache
81func (c RemoteCache) DeleteBlobs(ctx context.Context, blobIDs []string) error {

Callers 1

Calls 3

RetryFunction · 0.92
MissingBlobsMethod · 0.65

Tested by 1