mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
chore: do not include kernel module cataloger by default (#1784)
This commit is contained in:
parent
d63a1f5f80
commit
354c72bbf4
@ -49,7 +49,6 @@ func ImageCatalogers(cfg Config) []pkg.Cataloger {
|
|||||||
java.NewJavaCataloger(cfg.Java()),
|
java.NewJavaCataloger(cfg.Java()),
|
||||||
java.NewNativeImageCataloger(),
|
java.NewNativeImageCataloger(),
|
||||||
javascript.NewPackageCataloger(),
|
javascript.NewPackageCataloger(),
|
||||||
kernel.NewLinuxKernelCataloger(cfg.Kernel()),
|
|
||||||
nix.NewStoreCataloger(),
|
nix.NewStoreCataloger(),
|
||||||
php.NewComposerInstalledCataloger(),
|
php.NewComposerInstalledCataloger(),
|
||||||
portage.NewPortageCataloger(),
|
portage.NewPortageCataloger(),
|
||||||
@ -80,7 +79,6 @@ func DirectoryCatalogers(cfg Config) []pkg.Cataloger {
|
|||||||
java.NewJavaPomCataloger(),
|
java.NewJavaPomCataloger(),
|
||||||
java.NewNativeImageCataloger(),
|
java.NewNativeImageCataloger(),
|
||||||
javascript.NewLockCataloger(),
|
javascript.NewLockCataloger(),
|
||||||
kernel.NewLinuxKernelCataloger(cfg.Kernel()),
|
|
||||||
nix.NewStoreCataloger(),
|
nix.NewStoreCataloger(),
|
||||||
php.NewComposerLockCataloger(),
|
php.NewComposerLockCataloger(),
|
||||||
portage.NewPortageCataloger(),
|
portage.NewPortageCataloger(),
|
||||||
|
|||||||
@ -96,7 +96,7 @@ func TestPackagesCmdFlags(t *testing.T) {
|
|||||||
name: "squashed-scope-flag",
|
name: "squashed-scope-flag",
|
||||||
args: []string{"packages", "-o", "json", "-s", "squashed", coverageImage},
|
args: []string{"packages", "-o", "json", "-s", "squashed", coverageImage},
|
||||||
assertions: []traitAssertion{
|
assertions: []traitAssertion{
|
||||||
assertPackageCount(37),
|
assertPackageCount(35),
|
||||||
assertSuccessfulReturnCode,
|
assertSuccessfulReturnCode,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -213,7 +213,7 @@ func TestPackagesCmdFlags(t *testing.T) {
|
|||||||
// the application config in the log matches that of what we expect to have been configured.
|
// the application config in the log matches that of what we expect to have been configured.
|
||||||
assertInOutput("parallelism: 2"),
|
assertInOutput("parallelism: 2"),
|
||||||
assertInOutput("parallelism=2"),
|
assertInOutput("parallelism=2"),
|
||||||
assertPackageCount(37),
|
assertPackageCount(35),
|
||||||
assertSuccessfulReturnCode,
|
assertSuccessfulReturnCode,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -224,7 +224,7 @@ func TestPackagesCmdFlags(t *testing.T) {
|
|||||||
// the application config in the log matches that of what we expect to have been configured.
|
// the application config in the log matches that of what we expect to have been configured.
|
||||||
assertInOutput("parallelism: 1"),
|
assertInOutput("parallelism: 1"),
|
||||||
assertInOutput("parallelism=1"),
|
assertInOutput("parallelism=1"),
|
||||||
assertPackageCount(37),
|
assertPackageCount(35),
|
||||||
assertSuccessfulReturnCode,
|
assertSuccessfulReturnCode,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -238,7 +238,7 @@ func TestPackagesCmdFlags(t *testing.T) {
|
|||||||
assertions: []traitAssertion{
|
assertions: []traitAssertion{
|
||||||
assertNotInOutput("secret_password"),
|
assertNotInOutput("secret_password"),
|
||||||
assertNotInOutput("secret_key_path"),
|
assertNotInOutput("secret_key_path"),
|
||||||
assertPackageCount(37),
|
assertPackageCount(35),
|
||||||
assertSuccessfulReturnCode,
|
assertSuccessfulReturnCode,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -11,20 +11,6 @@ type testCase struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var imageOnlyTestCases = []testCase{
|
var imageOnlyTestCases = []testCase{
|
||||||
{
|
|
||||||
name: "find kernel packages",
|
|
||||||
pkgType: pkg.LinuxKernelPkg,
|
|
||||||
pkgInfo: map[string]string{
|
|
||||||
"linux-kernel": "6.0.7-301.fc37.x86_64",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "find kernel module packages",
|
|
||||||
pkgType: pkg.LinuxKernelModulePkg,
|
|
||||||
pkgInfo: map[string]string{
|
|
||||||
"ttynull": "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "find gemspec packages",
|
name: "find gemspec packages",
|
||||||
pkgType: pkg.GemPkg,
|
pkgType: pkg.GemPkg,
|
||||||
|
|||||||
@ -91,6 +91,8 @@ func TestPkgCoverageImage(t *testing.T) {
|
|||||||
definedPkgs.Remove(string(pkg.HackagePkg))
|
definedPkgs.Remove(string(pkg.HackagePkg))
|
||||||
definedPkgs.Remove(string(pkg.BinaryPkg))
|
definedPkgs.Remove(string(pkg.BinaryPkg))
|
||||||
definedPkgs.Remove(string(pkg.HexPkg))
|
definedPkgs.Remove(string(pkg.HexPkg))
|
||||||
|
definedPkgs.Remove(string(pkg.LinuxKernelPkg))
|
||||||
|
definedPkgs.Remove(string(pkg.LinuxKernelModulePkg))
|
||||||
|
|
||||||
var cases []testCase
|
var cases []testCase
|
||||||
cases = append(cases, commonTestCases...)
|
cases = append(cases, commonTestCases...)
|
||||||
@ -220,9 +222,9 @@ func TestPkgCoverageDirectory(t *testing.T) {
|
|||||||
definedLanguages.Remove(pkg.UnknownLanguage.String())
|
definedLanguages.Remove(pkg.UnknownLanguage.String())
|
||||||
observedPkgs.Remove(string(pkg.UnknownPkg))
|
observedPkgs.Remove(string(pkg.UnknownPkg))
|
||||||
definedPkgs.Remove(string(pkg.BinaryPkg))
|
definedPkgs.Remove(string(pkg.BinaryPkg))
|
||||||
definedPkgs.Remove(string(pkg.UnknownPkg))
|
|
||||||
definedPkgs.Remove(string(pkg.LinuxKernelPkg))
|
definedPkgs.Remove(string(pkg.LinuxKernelPkg))
|
||||||
definedPkgs.Remove(string(pkg.LinuxKernelModulePkg))
|
definedPkgs.Remove(string(pkg.LinuxKernelModulePkg))
|
||||||
|
definedPkgs.Remove(string(pkg.UnknownPkg))
|
||||||
|
|
||||||
// for directory scans we should not expect to see any of the following package types
|
// for directory scans we should not expect to see any of the following package types
|
||||||
definedPkgs.Remove(string(pkg.KbPkg))
|
definedPkgs.Remove(string(pkg.KbPkg))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user