mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Include default config licenses (#3900)
* fix: the licenses config was not being carried through causing content to show by default --------- Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
parent
b369b02f4f
commit
4f73d35051
@ -255,6 +255,7 @@ func (c *CreateSBOMConfig) selectTasks(src source.Description) ([]task.Task, []t
|
||||
RelationshipsConfig: c.Relationships,
|
||||
DataGenerationConfig: c.DataGeneration,
|
||||
PackagesConfig: c.Packages,
|
||||
LicenseConfig: c.Licenses,
|
||||
ComplianceConfig: c.Compliance,
|
||||
FilesConfig: c.Files,
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package cli
|
||||
import "testing"
|
||||
|
||||
func Test_Licenses(t *testing.T) {
|
||||
testImage := getFixtureImage(t, "image-unknown-licenses")
|
||||
testImage := getFixtureImage(t, "image-pkg-coverage")
|
||||
tests := []struct {
|
||||
name string
|
||||
args []string
|
||||
|
||||
@ -169,7 +169,7 @@ func assertUnknownLicenseContent(required bool) traitAssertion {
|
||||
|
||||
for _, pkg := range data.Artifacts {
|
||||
for _, lic := range pkg.Licenses {
|
||||
if strings.Contains(lic.SPDXExpression, "UNKNOWN") && required {
|
||||
if strings.Contains(lic.Value, "sha256") && required {
|
||||
assert.NotZero(tb, len(lic.Contents))
|
||||
} else {
|
||||
assert.Empty(tb, lic.Contents)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user