-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: report unknowns in sbom (#2998)
Signed-off-by: Keith Zantow <[email protected]> Signed-off-by: Alex Goodman <[email protected]> Co-authored-by: Alex Goodman <[email protected]>
- Loading branch information
Showing
145 changed files
with
4,420 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package options | ||
|
||
import ( | ||
"github.com/anchore/clio" | ||
"github.com/anchore/syft/syft/cataloging" | ||
) | ||
|
||
type unknownsConfig struct { | ||
RemoveWhenPackagesDefined bool `json:"remove-when-packages-defined" yaml:"remove-when-packages-defined" mapstructure:"remove-when-packages-defined"` | ||
ExecutablesWithoutPackages bool `json:"executables-without-packages" yaml:"executables-without-packages" mapstructure:"executables-without-packages"` | ||
UnexpandedArchives bool `json:"unexpanded-archives" yaml:"unexpanded-archives" mapstructure:"unexpanded-archives"` | ||
} | ||
|
||
var _ interface { | ||
clio.FieldDescriber | ||
} = (*unknownsConfig)(nil) | ||
|
||
func (o *unknownsConfig) DescribeFields(descriptions clio.FieldDescriptionSet) { | ||
descriptions.Add(&o.RemoveWhenPackagesDefined, `remove unknown errors on files with discovered packages`) | ||
descriptions.Add(&o.ExecutablesWithoutPackages, `include executables without any identified packages`) | ||
descriptions.Add(&o.UnexpandedArchives, `include archives which were not expanded and searched`) | ||
} | ||
|
||
func defaultUnknowns() unknownsConfig { | ||
def := cataloging.DefaultUnknownsConfig() | ||
return unknownsConfig{ | ||
RemoveWhenPackagesDefined: def.RemoveWhenPackagesDefined, | ||
ExecutablesWithoutPackages: def.IncludeExecutablesWithoutPackages, | ||
UnexpandedArchives: def.IncludeUnexpandedArchives, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.