mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
* migrate location structs to file package Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * replace source.Location refs with file package call Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix linting Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * remove hardlink test for file based catalogers Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * remove hardlink test for all-regular-files testing Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * migrate file resolver implementations to separate package Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix linting Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * [wip] migrate resolvers to internal Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * migrate resolvers to syft/internal Signed-off-by: Alex Goodman <alex.goodman@anchore.com> --------- Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: <>
16 lines
348 B
Go
16 lines
348 B
Go
package fileresolver
|
|
|
|
import (
|
|
"github.com/anchore/stereoscope/pkg/image"
|
|
"github.com/anchore/syft/syft/file"
|
|
)
|
|
|
|
func fileMetadataByLocation(img *image.Image, location file.Location) (file.Metadata, error) {
|
|
entry, err := img.FileCatalog.Get(location.Reference())
|
|
if err != nil {
|
|
return file.Metadata{}, err
|
|
}
|
|
|
|
return entry.Metadata, nil
|
|
}
|