Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/detector/ospkg/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (s *Scanner) Detect(ctx context.Context, _ string, _ *ftypes.Repository, pk
if err != nil {
return nil, xerrors.Errorf("failed to get echo advisories: %w", err)
}
formattedInstalledVersion := utils.FormatVersion(pkg)
formattedInstalledVersion := utils.FormatSrcVersion(pkg)
installedVersion, err := version.NewVersion(formattedInstalledVersion)
if err != nil {
return nil, xerrors.Errorf("failed to parse installed version: %w", err)
Expand Down
6 changes: 4 additions & 2 deletions pkg/detector/ospkg/echo/echo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func TestScanner_Detect(t *testing.T) {
SrcName: "nginx",
SrcVersion: "1.14.2",
Release: "1ubuntu1",
SrcRelease: "1ubuntu1",
Layer: ftypes.Layer{
DiffID: "sha256:932da51564135c98a49a34a193d6cd363d8fa4184d957fde16c9d8527b3f3b02",
},
Expand All @@ -163,6 +164,7 @@ func TestScanner_Detect(t *testing.T) {
Version: "2.4.24",
SrcVersion: "2.4.24",
Release: "2",
SrcRelease: "2",
Layer: ftypes.Layer{
DiffID: "sha256:932da51564135c98a49a34a193d6cd363d8fa4184d957fde16c9d8527b3f3b02",
},
Expand Down Expand Up @@ -226,7 +228,7 @@ func TestScanner_Detect(t *testing.T) {
name: "happy path - no matching packages",
args: args{
pkgs: []ftypes.Package{
{ID: "echo", Version: "1.0.0"},
{ID: "echo", Version: "1.0.0", SrcVersion: "1.0.0", SrcName: "echo"},
},
},
want: nil,
Expand All @@ -239,7 +241,7 @@ func TestScanner_Detect(t *testing.T) {
},
args: args{
pkgs: []ftypes.Package{
{SrcName: "apache2", Version: "1.0.0"},
{SrcName: "apache2", Version: "1.0.0", SrcVersion: "1.0.0"},
},
},
wantErr: "failed to get echo advisories",
Expand Down
Loading