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

aya: make KernelVersion::code public #836

Merged
merged 1 commit into from
Nov 18, 2023

Conversation

nrxus
Copy link
Contributor

@nrxus nrxus commented Nov 10, 2023

I need to be able to access the current kernel version code so I can make some decisions in user space and/or send the information to the eBPF programs to make the decisions.

I could re-implement the logic to get the kernel version myself but since aya already has all the logic and is well tested I figured it made the most sense to expose the method I had previously implemented here. Another alternative would be to expose the fields inside KernelVersion but that felt like a bigger surface area to guarantee no breaking changes rather than just the one method.

Maybe in the future we should implement the __kconfig stuff that libbpf and cilium allow so that the eBPF programs will know the KERNEL_VERSION_CODE but that felt heavyweight to implement at the moment and I wasn't sure if CO-RE was required for it which my current programs do not support.

Copy link

netlify bot commented Nov 10, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a03295b
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/654e87043a8119000808b847
😎 Deploy Preview https://deploy-preview-836--aya-rs-docs.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.

Copy link

mergify bot commented Nov 10, 2023

Hey @alessandrod, this pull request changes the Aya Public API and requires your review.

@mergify mergify bot requested a review from alessandrod November 10, 2023 19:40
@mergify mergify bot added api/needs-review Makes an API change that needs review aya This is about aya (userspace) test A PR that improves test cases or CI labels Nov 10, 2023
Copy link
Member

@astoycos astoycos left a comment

Choose a reason for hiding this comment

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

current() is already public I don't see any reason exposing code() is an issue 👍

Just need @alessandrod Because of the API change, thanks!

@alessandrod alessandrod merged commit 68ba020 into aya-rs:main Nov 18, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/needs-review Makes an API change that needs review aya This is about aya (userspace) test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants