mirror of
https://github.com/anchore/syft.git
synced 2026-10-11 21:57:22 +02:00
Add file catalogers to selection configuration (#3505)
* add file catalogers to selection configuration Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix typos Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * warn when there is conflicting file cataloging configuration Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * allow for explicit removal of all package and file tasks Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * address PR feedback Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -298,6 +298,15 @@ func TestPackagesCmdFlags(t *testing.T) {
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "select-no-package-catalogers",
|
||||
args: []string{"scan", "-o", "json", "--select-catalogers", "-package", coverageImage},
|
||||
assertions: []traitAssertion{
|
||||
assertPackageCount(0),
|
||||
assertInOutput(`"used":["file-content-cataloger","file-digest-cataloger","file-executable-cataloger","file-metadata-cataloger"]`),
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "override-default-catalogers-option",
|
||||
// This will detect enable:
|
||||
@@ -311,6 +320,15 @@ func TestPackagesCmdFlags(t *testing.T) {
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "override-default-catalogers-with-files",
|
||||
args: []string{"packages", "-o", "json", "--override-default-catalogers", "file", coverageImage},
|
||||
assertions: []traitAssertion{
|
||||
assertPackageCount(0),
|
||||
assertInOutput(`"used":["file-content-cataloger","file-digest-cataloger","file-executable-cataloger","file-metadata-cataloger"]`),
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "new and old cataloger options are mutually exclusive",
|
||||
args: []string{"packages", "-o", "json", "--override-default-catalogers", "python", "--catalogers", "gemspec", coverageImage},
|
||||
|
||||
Reference in New Issue
Block a user