-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Modularize iptables manager #28746
Modularize iptables manager #28746
Conversation
/test |
c15bed0
to
aa4c0b0
Compare
aa4c0b0
to
5eaef6a
Compare
I've addressed all the feedbacks (the ones regarding modules manager have been pushed in the specific PR as well) but I'm planning to rework this quite a lot, so still not ready for review yet. |
5b7d4df
to
863ec7d
Compare
863ec7d
to
7ae9016
Compare
dbca706
to
0d58076
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just one nit, but given its copied code will not block on that
Fix iptables manager name to avoid the repetion of "iptables" in both package and type names (as suggested in "Effective Go" guidelines about naming: https://go.dev/doc/effective_go#names) Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Modularize iptables configuration manager into its own cell. The previous Init method is replaced with an Invoke function in order to be executed when starting the iptables manager cell. Also, enableIPForwarding is moved in the iptables package and kept unexported, since it is not used outside of the package. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
iptables has been modularized into a cell, but still depends directly on option.DaemonConfig global variables and helpers. The configuration flags that are "private" to the cell are provided through cell.Config. Regarding the flags and the helpers shared with other parts of the code, a SharedConfig struct is provided in the cell itself. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
0d58076
to
6055a83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - LGTM!
Move AddToNodeIpset and RemoveFromNodeIpset into the iptables manager, so that other cells depending on them will import the iptables config manager through dependency injection. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
6055a83
to
c9fa608
Compare
Force-pushed to fix controlplane tests: |
/test |
Conformance Cluster Mesh failure tracked here, rerunning. |
Modularize the iptables configuration manager in a cell.
Direct dependency to the DaemonConfig global object is avoided through a SharedConfig privately provided to the cell. This config gets the values from all the referenced DaemonConfig helpers at startup, in order to be used by the new cell.
Also, cells depending on iptables (like the node manager one) now takes a reference to it through dependency injection instead of directly calling side effectful exported functions.
Depends on #28713