diff --git a/pkg/scanner/scan.go b/pkg/scanner/scan.go index f1e4cf68c515..4009ddba8a4d 100644 --- a/pkg/scanner/scan.go +++ b/pkg/scanner/scan.go @@ -178,11 +178,6 @@ func (s Scanner) ScanArtifact(ctx context.Context, options types.ScanOptions) (t ptros = nil } - // Layer makes sense only when scanning container images - if artifactInfo.Type != artifact.TypeContainerImage { - removeLayer(results) - } - return types.Report{ SchemaVersion: report.SchemaVersion, CreatedAt: clock.Now(ctx), @@ -202,19 +197,3 @@ func (s Scanner) ScanArtifact(ctx context.Context, options types.ScanOptions) (t BOM: artifactInfo.BOM, }, nil } - -func removeLayer(results types.Results) { - for i := range results { - result := results[i] - - for j := range result.Packages { - result.Packages[j].Layer = ftypes.Layer{} - } - for j := range result.Vulnerabilities { - result.Vulnerabilities[j].Layer = ftypes.Layer{} - } - for j := range result.Misconfigurations { - result.Misconfigurations[j].Layer = ftypes.Layer{} - } - } -}