Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tetragon: Several observer related cleanups #1525

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

olsajiri
Copy link
Contributor

Several observer related cleanups.

@olsajiri olsajiri added the release-note/minor This PR introduces a minor user-visible change label Sep 29, 2023
@olsajiri olsajiri marked this pull request as ready for review September 29, 2023 18:37
@olsajiri olsajiri requested a review from a team as a code owner September 29, 2023 18:37
@olsajiri olsajiri requested a review from kkourt September 29, 2023 18:37
There's no need to create observer, we can just create
the policy and call sensors policy handlers.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Moving TestKprobeOverrideNonSyscall to kprobe_validation_test.go
as TestKprobeValidationNonSyscallOverride, because It's pure crd
validation test.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
And related GetDefaultObserverWithFileNoTest function
and related code, which is no longer used.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
The GetDefaultSensorsWithFile needs to return loaded sensors
without observer. This complicates other functions that return
observer object with loaded sensors.

Implementing GetDefaultSensorsWithFile directly without common
code to ease up following changes.

Remove ctx argument, because it's no longer needed.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
It's no longer needed, moving it to be directly getDefaultObserver
function and not to return any sensor objects.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

var sensor *sensors.Sensor

if tp != nil {
sensor, err = sensors.GetMergedSensorFromParserPolicy(tp)
Copy link
Contributor

@kkourt kkourt Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor note: I'd like to remove the GetMergedSensorsFromParserPolicy and use everywhere the same code path: parse the policy, get a list of sensors, and we load the sensors. No need to change it now, but something to avoid in the future.

@olsajiri olsajiri merged commit 8717bb2 into cilium:main Oct 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants