mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
Add ability to pull images directly from a registry (#378)
* add registry image source Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * use explicit source for fetching image + add scheme and registry tests Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * adjust test variable name and add credential helper function Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
@@ -23,7 +23,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)
|
||||
theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil)
|
||||
b.Cleanup(cleanupSource)
|
||||
if err != nil {
|
||||
b.Fatalf("unable to get source: %+v", err)
|
||||
|
||||
@@ -14,7 +14,7 @@ func catalogFixtureImage(t *testing.T, fixtureImageName string) (*pkg.Catalog, *
|
||||
imagetest.GetFixtureImage(t, "docker-archive", fixtureImageName)
|
||||
tarPath := imagetest.GetFixtureImageTarPath(t, fixtureImageName)
|
||||
|
||||
theSource, cleanupSource, err := source.New("docker-archive:" + tarPath)
|
||||
theSource, cleanupSource, err := source.New("docker-archive:"+tarPath, nil)
|
||||
t.Cleanup(cleanupSource)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get source: %+v", err)
|
||||
@@ -29,7 +29,7 @@ func catalogFixtureImage(t *testing.T, fixtureImageName string) (*pkg.Catalog, *
|
||||
}
|
||||
|
||||
func catalogDirectory(t *testing.T, dir string) (*pkg.Catalog, *distro.Distro, source.Source) {
|
||||
theSource, cleanupSource, err := source.New("dir:" + dir)
|
||||
theSource, cleanupSource, err := source.New("dir:"+dir, nil)
|
||||
t.Cleanup(cleanupSource)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get source: %+v", err)
|
||||
|
||||
Reference in New Issue
Block a user