Skip to content

Comments

prog: fix tautological AttachTo condition in ProgramSpec.kernelModule#1640

Merged
ti-mo merged 2 commits intocilium:mainfrom
brycekahle:bryce.kahle/fix-kernel-module
Jan 15, 2025
Merged

prog: fix tautological AttachTo condition in ProgramSpec.kernelModule#1640
ti-mo merged 2 commits intocilium:mainfrom
brycekahle:bryce.kahle/fix-kernel-module

Conversation

@brycekahle
Copy link
Contributor

It should've been ps.AttachTo != "", but targetsKernelModule already checks that condition, so just remove it completely.

@brycekahle brycekahle requested a review from a team as a code owner January 6, 2025 21:47
Copy link
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks! If this made it through, that means test coverage is lacking. Maybe now's a good opportunity to add one? You can assume bpf_testmod is loaded in CI if that helps.

@brycekahle
Copy link
Contributor Author

@ti-mo added some tests

@brycekahle brycekahle requested a review from ti-mo January 14, 2025 17:51
ti-mo and others added 2 commits January 15, 2025 14:04
This allows calling requireTestmod in a loop for marking subtests as requiring
bpf_testmod.

Signed-off-by: Timo Beckers <[email protected]>
This fixes a bug introduced by a refactor in 0.17. targetsKernelModule() already
checks for AttachTo == "", so drop the statement.

Signed-off-by: Bryce Kahle <[email protected]>
Co-authored-by: Timo Beckers <[email protected]>
@ti-mo ti-mo force-pushed the bryce.kahle/fix-kernel-module branch from a850752 to fbf9bb0 Compare January 15, 2025 13:07
@ti-mo ti-mo changed the title fix kernelModule AttachTo condition prog: fix tautological AttachTo condition in ProgramSpec.kernelModule Jan 15, 2025
@ti-mo ti-mo merged commit fd1fe1b into cilium:main Jan 15, 2025
16 of 17 checks passed
@brycekahle brycekahle deleted the bryce.kahle/fix-kernel-module branch January 22, 2025 17:51
@brycekahle
Copy link
Contributor Author

@ti-mo any chance of getting a minor release for this fix? I don't think kernel module programs will work without it.

@ti-mo
Copy link
Contributor

ti-mo commented Jan 24, 2025

@ti-mo any chance of getting a minor release for this fix? I don't think kernel module programs will work without it.

@brycekahle Yep, aiming for Mon/Tues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants