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.
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes:
Fixes #(issue-number)
WHAT
🤖 Generated by Copilot at 9a26853
This pull request updates and refactors the iptables management for the project, using a newer
go-iptables
library and adding support for nft mode. It also adds a new utility function for parsing iptables rules with double-quoted comments.🤖 Generated by Copilot at 9a26853
HOW
🤖 Generated by Copilot at 9a26853
github.com/coreos/go-iptables
with the updated forkgithub.com/kubeovn/go-iptables
(link,link,link,link)iptablesObsolete
to the Controller struct, and initialize it with the legacy mode iptables instances if the iptables works in nft mode (link,link)filepath.EvalSymlinks
function (link)abandonedRules
toobsoleteRules
(link,link,link)ipt
(link,link)cleanObsoleteIptablesRules
to delete the obsolete iptables rules in the legacy mode, and clear the obsolete iptables chains (link)deleteObsoleteSnatRules
to delete the obsolete SNAT rules for the gateway node, and call it in thesetIptables
function (link)DoubleQuotedFields
to split a string into fields by spaces, but preserve the double-quoted parts as a single field, and use it to parse the iptables rules that contain double-quoted comments (link)