containernetworking / plugins

Some reference and example networking plugins, maintained by the CNI team.
Apache License 2.0
2.17k stars 778 forks source link

Review code using go-iptables module #924

Closed SirPhuttel closed 1 year ago

SirPhuttel commented 1 year ago

Patch 1 makes callers use the module-provided ChainExists() method, it is faster than the custom implementation. This does not bump dependencies, the required version of go-iptables in go.mod is already sufficient. Patch 2 tries to speed up meta/portmap plugin's teardown() by avoiding an expensive ipt.List() call (in big rulesets). Make it fall back to the old code for unexpected cases.