chore: add context to the cache interface (#9565)

This commit is contained in:
Owen Rumney
2025-10-03 10:37:05 +01:00
committed by GitHub
parent 3dd0ebbb56
commit 719ea29d31
28 changed files with 198 additions and 184 deletions

View File

@@ -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) {