Created GetIptablesMode to log legacy or nftables backend#3565
Created GetIptablesMode to log legacy or nftables backend#3565cdirubbio wants to merge 4 commits intoaws:masterfrom
Conversation
|
hey @cdirubbio can we add any kind of test for this? This will be helpful addition. |
|
I would suggest to use this code https://github.com/kubernetes-sigs/iptables-wrappers/blob/master/internal/iptables/detect.go#L48. It is internal so we cannot use this directly. |
c1204ac to
0f62b77
Compare
|
Added unit tests and this method is essentially just running https://github.com/coreos/go-iptables/blob/main/iptables/iptables.go#L654 |
e2aaabf to
86d6b87
Compare
|
Will run go fmt to fix the CI issue. Here's the manual testing: |
I chose to use the code from the private method in |
What type of PR is this? improvement
Which issue does this PR fix?:
What does this PR do / Why do we need it?:
/usr/sbin/iptables-wrapperpicks the iptables backend used based on a few conditions. With this change, a method is introduced to get the iptables mode (either nf_tables or legacy) in-use.The package
go-iptablesthat the vpc cni uses to interact with iptables is no longer being maintained, so this is the current solution. Following this change, we get the following log line during startup, prior to creation and insertion of iptables rules.Testing done on this change:
Will this PR introduce any new dependencies?:
Will this break upgrades or downgrades? Has updating a running cluster been tested?:
Does this change require updates to the CNI daemonset config files to work?:
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.