(ctx context.Context, instanceDigest *digest.Digest)
| 56 | } |
| 57 | |
| 58 | func (s *blobCacheSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { |
| 59 | if instanceDigest != nil { |
| 60 | filename, err := s.reference.blobPath(*instanceDigest, false) |
| 61 | if err != nil { |
| 62 | return nil, "", err |
| 63 | } |
| 64 | manifestBytes, err := os.ReadFile(filename) |
| 65 | if err == nil { |
| 66 | s.cacheHits++ |
| 67 | return manifestBytes, manifest.GuessMIMEType(manifestBytes), nil |
| 68 | } |
| 69 | if !os.IsNotExist(err) { |
| 70 | s.cacheErrors++ |
| 71 | return nil, "", fmt.Errorf("checking for manifest file: %w", err) |
| 72 | } |
| 73 | } |
| 74 | s.cacheMisses++ |
| 75 | return s.source.GetManifest(ctx, instanceDigest) |
| 76 | } |
| 77 | |
| 78 | func (s *blobCacheSource) HasThreadSafeGetBlob() bool { |
| 79 | return s.source.HasThreadSafeGetBlob() |
nothing calls this directly
no test coverage detected