Skip to content

Commit

Permalink
Revert "refactor: split ksplice1 and ksplice2"
Browse files Browse the repository at this point in the history
This reverts commit ed3cdbf.
  • Loading branch information
DmitriyLewen committed Nov 5, 2024
1 parent ed3cdbf commit a135499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
18 changes: 6 additions & 12 deletions pkg/vulnsrc/oracle-oval/oracle-oval.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,15 @@ func resolveVersions(vers []string) (string, []string) {
type PkgFlavor string

const (
NormalPackageFlavor PkgFlavor = "normal"
FipsPackageFlavor PkgFlavor = "fips"
Ksplice1PackageFlavor PkgFlavor = "ksplice1"
Ksplice2PackageFlavor PkgFlavor = "ksplice2"
NormalPackageFlavor PkgFlavor = "normal"
FipsPackageFlavor PkgFlavor = "fips"
KsplicePackageFlavor PkgFlavor = "ksplice"
)

// PackageFlavor determinants the package "flavor" based on its version string
// - normal
// - FIPS validated
// - ksplice1 userspace
// - ksplice2 userspace
// - ksplice userspace
func PackageFlavor(version string) PkgFlavor {
version = strings.ToLower(version)
if strings.HasSuffix(version, "_fips") {
Expand All @@ -269,12 +267,8 @@ func PackageFlavor(version string) PkgFlavor {

subs := strings.Split(version, ".")
for _, s := range subs {
if strings.HasPrefix(s, "ksplice1") {
return Ksplice1PackageFlavor
}

if strings.HasPrefix(s, "ksplice2") {
return Ksplice2PackageFlavor
if strings.HasPrefix(s, "ksplice") {
return KsplicePackageFlavor
}
}
return NormalPackageFlavor
Expand Down
3 changes: 0 additions & 3 deletions pkg/vulnsrc/oracle-oval/oracle-oval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ func TestVulnSrc_Update(t *testing.T) {
Key: []string{"advisory-detail", "CVE-2016-10228", "Oracle Linux 8", "glibc"},
Value: types.Advisories{
Entries: []types.Advisory{
{
FixedVersion: "2:2.28-151.0.1.ksplice1.el8",
},
{
FixedVersion: "2:2.28-151.0.1.ksplice2.el8",
},
Expand Down

0 comments on commit a135499

Please sign in to comment.