feat(image): save layers metadata into report (#8394)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
DmitriyLewen
2025-04-23 22:31:43 +06:00
committed by GitHub
parent 7abf5f0199
commit a95cab0eab
71 changed files with 1973 additions and 1069 deletions

View File

@@ -20,6 +20,8 @@ import (
"github.com/aquasecurity/trivy/pkg/sbom"
)
const artifactVersion = 0
type Artifact struct {
filePath string
cache cache.ArtifactCache
@@ -105,7 +107,7 @@ func (a Artifact) calcCacheKey(blobInfo types.BlobInfo) (string, error) {
}
d := digest.NewDigest(digest.SHA256, h)
cacheKey, err := cache.CalcKey(d.String(), a.analyzer.AnalyzerVersions(), a.handlerManager.Versions(), a.artifactOption)
cacheKey, err := cache.CalcKey(d.String(), artifactVersion, a.analyzer.AnalyzerVersions(), a.handlerManager.Versions(), a.artifactOption)
if err != nil {
return "", xerrors.Errorf("cache key: %w", err)
}