mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 07:40:48 -08:00
chore: add context to the cache interface (#9565)
This commit is contained in:
@@ -71,7 +71,7 @@ func (a Artifact) Inspect(ctx context.Context) (artifact.Reference, error) {
|
||||
return artifact.Reference{}, xerrors.Errorf("failed to calculate a cache key: %w", err)
|
||||
}
|
||||
|
||||
if err = a.cache.PutBlob(cacheKey, blobInfo); err != nil {
|
||||
if err = a.cache.PutBlob(ctx, cacheKey, blobInfo); err != nil {
|
||||
return artifact.Reference{}, xerrors.Errorf("failed to store blob (%s) in cache: %w", cacheKey, err)
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func (a Artifact) Inspect(ctx context.Context) (artifact.Reference, error) {
|
||||
}
|
||||
|
||||
func (a Artifact) Clean(reference artifact.Reference) error {
|
||||
return a.cache.DeleteBlobs(reference.BlobIDs)
|
||||
return a.cache.DeleteBlobs(context.TODO(), reference.BlobIDs)
|
||||
}
|
||||
|
||||
func (a Artifact) calcCacheKey(blobInfo types.BlobInfo) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user