diff --git a/cmd/packages.go b/cmd/packages.go index a2d51e05c54..5835bec217b 100644 --- a/cmd/packages.go +++ b/cmd/packages.go @@ -262,7 +262,7 @@ func packagesExecWorker(userInput string) <-chan error { checkForApplicationUpdate() - src, cleanup, err := source.New(userInput, appConfig.Registry.ToOptions(), appConfig.Exclusions...) + src, cleanup, err := source.New(userInput, appConfig.Registry.ToOptions(), appConfig.Exclusions) if err != nil { errs <- fmt.Errorf("failed to determine image source: %w", err) return diff --git a/cmd/power_user.go b/cmd/power_user.go index dfcd18bb7f1..1ef141a4b99 100644 --- a/cmd/power_user.go +++ b/cmd/power_user.go @@ -113,7 +113,7 @@ func powerUserExecWorker(userInput string) <-chan error { checkForApplicationUpdate() - src, cleanup, err := source.New(userInput, appConfig.Registry.ToOptions(), appConfig.Exclusions...) + src, cleanup, err := source.New(userInput, appConfig.Registry.ToOptions(), appConfig.Exclusions) if err != nil { errs <- err return diff --git a/syft/source/source.go b/syft/source/source.go index 9b0be8c57e3..58fbe0e4c40 100644 --- a/syft/source/source.go +++ b/syft/source/source.go @@ -35,7 +35,7 @@ type Source struct { type sourceDetector func(string) (image.Source, string, error) // New produces a Source based on userInput like dir: or image:tag -func New(userInput string, registryOptions *image.RegistryOptions, exclusions ...string) (*Source, func(), error) { +func New(userInput string, registryOptions *image.RegistryOptions, exclusions []string) (*Source, func(), error) { fs := afero.NewOsFs() parsedScheme, imageSource, location, err := detectScheme(fs, image.DetectSource, userInput) if err != nil { diff --git a/syft/source/source_test.go b/syft/source/source_test.go index edcc8ef2112..98e77454f25 100644 --- a/syft/source/source_test.go +++ b/syft/source/source_test.go @@ -420,7 +420,7 @@ func TestDirectoryExclusions(t *testing.T) { registryOpts := &image.RegistryOptions{} for _, test := range testCases { t.Run(test.desc, func(t *testing.T) { - src, fn, err := New("dir:"+test.input, registryOpts, test.exclusions...) + src, fn, err := New("dir:"+test.input, registryOpts, test.exclusions) defer fn() if test.err { @@ -512,7 +512,7 @@ func TestImageExclusions(t *testing.T) { for _, test := range testCases { t.Run(test.desc, func(t *testing.T) { archiveLocation := imagetest.PrepareFixtureImage(t, "docker-archive", test.input) - src, fn, err := New(archiveLocation, registryOpts, test.exclusions...) + src, fn, err := New(archiveLocation, registryOpts, test.exclusions) defer fn() if err != nil { diff --git a/test/integration/catalog_packages_test.go b/test/integration/catalog_packages_test.go index 1fe38baeedf..5ba3c910326 100644 --- a/test/integration/catalog_packages_test.go +++ b/test/integration/catalog_packages_test.go @@ -22,7 +22,7 @@ func BenchmarkImagePackageCatalogers(b *testing.B) { var pc *pkg.Catalog for _, c := range cataloger.ImageCatalogers() { // in case of future alteration where state is persisted, assume no dependency is safe to reuse - theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil) + theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil, nil) b.Cleanup(cleanupSource) if err != nil { b.Fatalf("unable to get source: %+v", err) diff --git a/test/integration/utils_test.go b/test/integration/utils_test.go index 342e9245ee2..5a52c1a9719 100644 --- a/test/integration/utils_test.go +++ b/test/integration/utils_test.go @@ -14,7 +14,7 @@ func catalogFixtureImage(t *testing.T, fixtureImageName string) (sbom.SBOM, *sou imagetest.GetFixtureImage(t, "docker-archive", fixtureImageName) tarPath := imagetest.GetFixtureImageTarPath(t, fixtureImageName) - theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil) + theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil, nil) t.Cleanup(cleanupSource) if err != nil { t.Fatalf("unable to get source: %+v", err) @@ -45,7 +45,7 @@ func catalogFixtureImage(t *testing.T, fixtureImageName string) (sbom.SBOM, *sou } func catalogDirectory(t *testing.T, dir string) (sbom.SBOM, *source.Source) { - theSource, cleanupSource, err := source.New("dir:"+dir, nil) + theSource, cleanupSource, err := source.New("dir:"+dir, nil, nil) t.Cleanup(cleanupSource) if err != nil { t.Fatalf("unable to get source: %+v", err)