Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tetragon: Use namespace in sensor policy directory #2987

Merged
merged 5 commits into from
Oct 15, 2024
Merged

Conversation

olsajiri
Copy link
Contributor

@olsajiri olsajiri commented Oct 10, 2024

Make sure the bpffs hierarchy tree works properly with namespaced policies.

Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 3927a9e
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/67098e0aeb500e0009b43f58
😎 Deploy Preview https://deploy-preview-2987--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@olsajiri olsajiri added the release-note/minor This PR introduces a minor user-visible change label Oct 10, 2024
@olsajiri olsajiri force-pushed the pr/olsajiri/fixes branch 5 times, most recently from 3927a9e to 6a06273 Compare October 11, 2024 21:33
Moving uprobes under tracing policy handler so we have
generic sensors under one policy handler, which makes
following changes simpler.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding namespace to policy directory name as prefix separated by ':'
character, which is not allowed for namespace or policy name.

We can have multiple namespaced policies with the same name which would
collide in bpffs directory, so we reflect the namespace in the policy
directory name, like:

  /sys/fs/bpf/ns1:policy/..
  /sys/fs/bpf/ns2:policy/..

The policy without namespace stays the same (has no prefix), like:

  /sys/fs/bpf/policy/..

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Propagate the namespace value to generic sensors.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding policy object directly to SensorBuilder function so we can
pass the namespace value to sensor object.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding sensor tests for namespace policy to verify we create
proper policy directory and that they are properly removed.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri changed the title Pr/olsajiri/fixes tetragon: Use namespace in sensor policy directory Oct 13, 2024
@olsajiri olsajiri marked this pull request as ready for review October 13, 2024 11:39
@olsajiri olsajiri requested a review from a team as a code owner October 13, 2024 11:39
@olsajiri olsajiri requested review from tpapagian and kkourt October 13, 2024 11:39
@olsajiri olsajiri requested review from mtardy and a team October 14, 2024 23:06
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!

pkg/sensors/sensors.go Show resolved Hide resolved
@olsajiri olsajiri merged commit da7d25a into main Oct 15, 2024
43 checks passed
@olsajiri olsajiri deleted the pr/olsajiri/fixes branch October 15, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

3 participants