From 6b2d73d4b7dd7954e0c6cd3f837a29d99fd0bbab Mon Sep 17 00:00:00 2001 From: GGMU <49076226+tomersein@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:03:54 +0200 Subject: [PATCH] allow disabling all package catalogers (#3468) Signed-off-by: tomersein --- syft/create_sbom_config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syft/create_sbom_config.go b/syft/create_sbom_config.go index 8e9e76b5c..7600415ec 100644 --- a/syft/create_sbom_config.go +++ b/syft/create_sbom_config.go @@ -7,6 +7,7 @@ import ( "runtime/debug" "strings" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/task" "github.com/anchore/syft/syft/cataloging" "github.com/anchore/syft/syft/cataloging/filecataloging" @@ -267,7 +268,8 @@ func (c *CreateSBOMConfig) packageTasks(src source.Description) ([]task.Task, *t finalTasks = append(finalTasks, persistentTasks...) if len(finalTasks) == 0 { - return nil, nil, fmt.Errorf("no catalogers selected") + log.Warn("no catalogers selected") + return finalTasks, &selection, nil } return finalTasks, &selection, nil