loader: refactor package and make individual BPF configuration objects pluggable#43479
Merged
ti-mo merged 17 commits intocilium:mainfrom Jan 6, 2026
Merged
loader: refactor package and make individual BPF configuration objects pluggable#43479ti-mo merged 17 commits intocilium:mainfrom
ti-mo merged 17 commits intocilium:mainfrom
Conversation
af2a895 to
4523c10
Compare
Contributor
Author
|
/test |
842db56 to
548c7c2
Compare
Contributor
Author
|
/test |
brb
reviewed
Jan 6, 2026
brb
reviewed
Jan 6, 2026
548c7c2 to
fa43b76
Compare
Contributor
Author
|
/test |
dylandreimerink
approved these changes
Jan 6, 2026
Signed-off-by: Timo Beckers <timo@isovalent.com>
There used to be some appends here, but these are fortunately long gone. Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
This commit renames config.StructToMap to config.Map and teaches it to accept slices of configuration objects as well as merging their results. This enables composing slices of configuration at runtime, e.g only when certain features are enabled, or to pull chunks of configuration data from Hive or other extra sources within the codebase. Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
…v.go Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
This commit refactors reinitializeIPSec into reinitializeEncryption for consistency and in preparation for pluggable datapath configuration objects. ELF loading and config generation was moved into its own file, encryption.go, and compilation once again takes place at the start of encrypt program attachment, while it was moved out before for concurrency reasons. It wasn't clear if this was still necessary as the surrounding code has changed significantly. Signed-off-by: Timo Beckers <timo@isovalent.com>
…able In preparation of un-embedding config.Node and making the loader's config mechanism(s) more composable, add a function registry type and refactor endpoint configuration into configureEndpoint(). Signed-off-by: Timo Beckers <timo@isovalent.com>
Like the previous commit, make bpf_overlay's configuration gathering pluggable and composable. Signed-off-by: Timo Beckers <timo@isovalent.com>
Like the previous commit, make cilium_host, cilium_net and netdev BPF configuration composable. Signed-off-by: Timo Beckers <timo@isovalent.com>
Like the previous commit, make bpf_wireguard's configuration gathering pluggable and composable. Signed-off-by: Timo Beckers <timo@isovalent.com>
Like the previous commit, make bpf_xdp's configuration gathering pluggable and composable. Signed-off-by: Timo Beckers <timo@isovalent.com>
Like the previous commit, make bpf_network's configuration gathering pluggable and composable. Signed-off-by: Timo Beckers <timo@isovalent.com>
bpfMasqAddrs directly referred to option.Config and it was generally hard to figure out what exactly it was trying to do. This commit hopefully makes things a bit more readable and removed the direct dependency on option.Config. Also added a negative test case to TestBPFMasqAddrs. Signed-off-by: Timo Beckers <timo@isovalent.com>
fa43b76 to
a10b130
Compare
Contributor
Author
|
/test |
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Best reviewed per commit. The package was long overdue for a split into multiple files for navigability.
Overall, there are 3 main changes:
endpoint.go,overlay.go,host/netdev.go,wireguard.go,xdp.goandencryption.goand moved topkg/datapath/confignext to the generated structs.CollectionOptions.Constantsnow supports (but doesn't force) an []any, enabling composing slices of configuration objects at runtime, e.g only when certain features are enabled, or to pull chunks of configuration data from Hive or other extra sources within the codebase. The future un-embedding ofconfig.Nodewill also leverage this work since we want to store it in Hive.CollectionOptions.Constantsis now fed with the output of functions (likeoverlayConfiguration) that gather objects from all registered providers and return it in a single slice.