mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 07:40:48 -08:00
feat(image): save layers metadata into report (#8394)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user