Skip to content

Commit

Permalink
changed check to be same as VerifyOSVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
CordeliaLopez committed Dec 18, 2023
1 parent 65473bc commit 4b2e7ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/network/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ func (t *Tracer) DebugDumpProcessCache(ctx context.Context) (interface{}, error)
}

func canRunProcessEventStream(kernelVersion *ebpfkernel.Version) bool {
if kernelVersion.IsRH7Kernel() || (!kernelVersion.IsRH8Kernel() && kernelVersion.Code < ebpfkernel.Kernel4_15) {
if !p.kernelVersion.IsRH7Kernel() && !p.kernelVersion.IsRH8Kernel() && p.kernelVersion.Code < kernel.Kernel4_15 {
log.Warn("disabling process event monitoring as it is not supported for this kernel version")
return false
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/network/tracer/tracer_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2166,8 +2166,8 @@ func (s *TracerSuite) TestPESisDisabledForUnsupportedKernels() {
require.NoError(t, err)
// fail if tracer cannot start
tr := setupTracer(t, cfg)
if kv.Code >= kv4150 || kv.IsRH8Kernel() {
t.Skip("These checks should only be run on kernels < 4.15.0 and RH7")
if kv.Code >= kv4150 || kv.IsRH8Kernel() || kv.IsRH7Kernel() {
t.Skip("These checks should only be run on kernels < 4.15.0 and RH7 | RH8")
}
require.Nil(t, tr.processCache)
require.False(t, events.VerifyEventMonitorLoadSucceeded())
Expand All @@ -2182,8 +2182,8 @@ func (s *TracerSuite) TestPESisEnabledForSupportedKernels() {
require.NoError(t, err)
// fail if tracer cannot start
tr := setupTracer(t, cfg)
if kv.Code < kv4150 || kv.IsRH7Kernel() {
t.Skip("These checks should only be run on kernels >= 4.15.0 and RH8")
if kv.Code < kv4150 {
t.Skip("These checks should only be run on kernels >= 4.15.0")
}
require.NotNil(t, tr.processCache)
require.True(t, events.VerifyEventMonitorLoadSucceeded())
Expand Down

0 comments on commit 4b2e7ad

Please sign in to comment.