Skip to content

Commit

Permalink
refactor: use ksplice1/fips if normal flavor doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Nov 19, 2024
1 parent a135499 commit cb14132
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/vulnsrc/oracle-oval/oracle-oval.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ func resolveVersions(vers []string) (string, []string) {
versions := lo.Values(fixedVers)
slices.Sort(versions)

fixedVersion := fixedVers[NormalPackageFlavor]
fixedVersion, ok := fixedVers[NormalPackageFlavor]
// To keep the previous logic - use the ksplice/fips version if the normal flavor doesn't exist.
if !ok {
fixedVersion = versions[0]
}

return fixedVersion, versions
}
Expand Down Expand Up @@ -306,7 +310,7 @@ func (o *Oracle) Get(release string, pkgName string) ([]types.Advisory, error) {
return nil, xerrors.Errorf("failed to unmarshal advisory JSON: %w", err)
}

// For backward compatibility
// For backward compatibility (This code can be deleted after Dec 19th, 2024)
// The old trivy-db has no entries, but has fixed versions and custom fields.
if len(adv.Entries) == 0 {
advisories = append(advisories, types.Advisory{
Expand Down

0 comments on commit cb14132

Please sign in to comment.