allow disabling all package catalogers (#3468)

Signed-off-by: tomersein <tomersein@gmail.com>
This commit is contained in:
GGMU 2025-01-16 20:03:54 +02:00 committed by GitHub
parent c359c76934
commit 6b2d73d4b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import (
"runtime/debug" "runtime/debug"
"strings" "strings"
"github.com/anchore/syft/internal/log"
"github.com/anchore/syft/internal/task" "github.com/anchore/syft/internal/task"
"github.com/anchore/syft/syft/cataloging" "github.com/anchore/syft/syft/cataloging"
"github.com/anchore/syft/syft/cataloging/filecataloging" "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...) finalTasks = append(finalTasks, persistentTasks...)
if len(finalTasks) == 0 { 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 return finalTasks, &selection, nil