feat: report unknowns in sbom (#2998)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Keith Zantow
2024-10-07 16:11:37 -04:00
committed by GitHub
co-authored by Alex Goodman
parent 4d7ed9f749
commit ccbee94b87
145 changed files with 4420 additions and 233 deletions
+15
View File
@@ -90,6 +90,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "image"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -108,6 +109,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "directory"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -127,6 +129,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "directory"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -145,6 +148,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "image"),
fileCatalogerNames(false, true, true), // note: the digest cataloger is not included
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -163,6 +167,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "image"),
// note: there are no file catalogers in their own group
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -184,6 +189,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
fileCatalogerNames(true, true, true)...,
),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -204,6 +210,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
addTo(pkgCatalogerNamesWithTagOrName(t, "image"), "persistent"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -224,6 +231,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
addTo(pkgCatalogerNamesWithTagOrName(t, "directory"), "persistent"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -244,6 +252,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
addTo(pkgIntersect("image", "javascript"), "persistent"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -265,6 +274,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
addTo(pkgCatalogerNamesWithTagOrName(t, "image"), "user-provided"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -285,6 +295,7 @@ func TestCreateSBOMConfig_makeTaskGroups(t *testing.T) {
pkgCatalogerNamesWithTagOrName(t, "image"),
fileCatalogerNames(true, true, true),
relationshipCatalogerNames(),
unknownsTaskNames(),
},
wantManifest: &catalogerManifest{
Requested: pkgcataloging.SelectionRequest{
@@ -385,6 +396,10 @@ func relationshipCatalogerNames() []string {
return []string{"relationships-cataloger"}
}
func unknownsTaskNames() []string {
return []string{"unknowns-labeler"}
}
func environmentCatalogerNames() []string {
return []string{"environment-cataloger"}
}