Skip to content

Commit

Permalink
fix(redhat_cpe): do not return an error
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Jan 19, 2021
1 parent a66a884 commit ad8d906
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/db/redhat_cpe.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (dbc Config) GetRedHatCPEs(repository string) ([]string, error) {
err := db.View(func(tx *bolt.Tx) error {
bucket := tx.Bucket([]byte(redhatCPEBucket))
if bucket == nil {
return xerrors.Errorf("no such bucket (%s)", redhatCPEBucket)
return nil
}

b := bucket.Get([]byte(repository))
Expand Down
8 changes: 6 additions & 2 deletions pkg/vulnsrc/redhat-oval/redhat-oval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ func TestVulnSrc_Get(t *testing.T) {
repositories: []string{"rhel-8-for-x86_64-baseos-rpms"},
},
fixtureFiles: []string{"testdata/fixtures/happy.yaml"},
want: []types.Advisory(nil),
wantErr: "no such bucket (Red Hat CPE)",
want: []types.Advisory{
{
VulnerabilityID: "CVE-2020-8624",
FixedVersion: "32:9.11.20-5.el8",
},
},
},
{
name: "broken JSON",
Expand Down

0 comments on commit ad8d906

Please sign in to comment.