From 66cb1350adc6743b0368a34de6bacffef239dde3 Mon Sep 17 00:00:00 2001 From: chenk Date: Tue, 2 Jan 2024 10:26:21 +0200 Subject: [PATCH] fix: os-packages missing-installed files Signed-off-by: chenk --- pkg/fanal/applier/docker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/fanal/applier/docker.go b/pkg/fanal/applier/docker.go index 44a64b669be4..36592a4e5ba6 100644 --- a/pkg/fanal/applier/docker.go +++ b/pkg/fanal/applier/docker.go @@ -120,17 +120,17 @@ func ApplyLayers(layers []types.BlobInfo) types.ArtifactDetail { return pkg.ID }) - newPackages := make(types.Packages, 0) + updatedPackages := make(types.Packages, 0) lo.ForEach(pkgInfo.Packages, func(pkg types.Package, _ int) { if mPkg, ok := mapPkgs[pkg.ID]; ok { pkg.InstalledFiles = lo.Uniq(append(pkg.InstalledFiles, mPkg.InstalledFiles...)) } - newPackages = append(newPackages, pkg) + updatedPackages = append(updatedPackages, pkg) }) nestedMap.SetByString(key, sep, types.PackageInfo{ FilePath: pkgInfo.FilePath, - Packages: newPackages, + Packages: updatedPackages, }) } }