From eb31efd6f8870a0cf864311213826f3d1fc39096 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Fri, 15 Dec 2023 17:07:55 -0500 Subject: [PATCH] use single source of truth for archive options (#2437) Signed-off-by: Alex Goodman --- syft/cataloging/config.go | 7 +++++++ syft/pkg/cataloger/java/config.go | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/syft/cataloging/config.go b/syft/cataloging/config.go index ba9b7e4a452..d8e4f397391 100644 --- a/syft/cataloging/config.go +++ b/syft/cataloging/config.go @@ -4,3 +4,10 @@ type ArchiveSearchConfig struct { IncludeIndexedArchives bool `yaml:"include-indexed-archives" json:"include-indexed-archives" mapstructure:"include-indexed-archives"` IncludeUnindexedArchives bool `yaml:"include-unindexed-archives" json:"include-unindexed-archives" mapstructure:"include-unindexed-archives"` } + +func DefaultArchiveSearchConfig() ArchiveSearchConfig { + return ArchiveSearchConfig{ + IncludeIndexedArchives: true, + IncludeUnindexedArchives: false, + } +} diff --git a/syft/pkg/cataloger/java/config.go b/syft/pkg/cataloger/java/config.go index 132f602478e..14c31d33426 100644 --- a/syft/pkg/cataloger/java/config.go +++ b/syft/pkg/cataloger/java/config.go @@ -13,10 +13,7 @@ type ArchiveCatalogerConfig struct { func DefaultArchiveCatalogerConfig() ArchiveCatalogerConfig { return ArchiveCatalogerConfig{ - ArchiveSearchConfig: cataloging.ArchiveSearchConfig{ - IncludeIndexedArchives: true, - IncludeUnindexedArchives: false, - }, + ArchiveSearchConfig: cataloging.DefaultArchiveSearchConfig(), UseNetwork: false, MavenBaseURL: mavenBaseURL, MaxParentRecursiveDepth: 5,