fix(sbom): add checksum to files (#3888)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
DmitriyLewen
2023-03-30 12:24:27 +06:00
committed by GitHub
parent 00de24b16e
commit 67236f6aac
37 changed files with 649 additions and 380 deletions

View File

@@ -609,6 +609,12 @@ func initScannerConfig(opts flag.Options, cacheClient cache.Cache) (ScannerConfi
}
}
// SPDX needs to calculate digests for package files
var fileChecksum bool
if opts.Format == report.FormatSPDXJSON || opts.Format == report.FormatSPDX {
fileChecksum = true
}
remoteOpts := opts.Remote()
return ScannerConfig{
@@ -635,6 +641,7 @@ func initScannerConfig(opts flag.Options, cacheClient cache.Cache) (ScannerConfi
Platform: opts.Platform,
Slow: opts.Slow,
AWSRegion: opts.Region,
FileChecksum: fileChecksum,
// For OCI registries
RemoteOptions: remoteOpts,