mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
tests: move existing json tests to json/imgs
Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
parent
7544330bc2
commit
96d86fa214
@ -2,6 +2,7 @@ package imgs
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/anchore/imgbom/imgbom/pkg"
|
||||
@ -82,6 +83,7 @@ func (pres *Presenter) Present(output io.Writer) error {
|
||||
}
|
||||
|
||||
// populate artifacts...
|
||||
// TODO: move this into a common package so that other text presenters can reuse
|
||||
for p := range pres.catalog.Enumerate() {
|
||||
art := artifact{
|
||||
Name: p.Name,
|
||||
@ -96,12 +98,11 @@ func (pres *Presenter) Present(output io.Writer) error {
|
||||
var layer int
|
||||
if err != nil {
|
||||
// TODO: test case
|
||||
log.Errorf("could not get metadata from catalog (presenter=json): %+v - error: %w", src, err)
|
||||
layer = 0
|
||||
} else {
|
||||
layer = int(fileMetadata.Source.Metadata.Index)
|
||||
return fmt.Errorf("could not get metadata from catalog (presenter=json src=%v): %w", src, err)
|
||||
}
|
||||
|
||||
layer = int(fileMetadata.Source.Metadata.Index)
|
||||
|
||||
srcObj := source{
|
||||
FoundBy: p.FoundBy,
|
||||
Layer: layer,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package json
|
||||
package imgs
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
Loading…
x
Reference in New Issue
Block a user