plugins/pkg/utils
Tim Gross 58dd90b996 ensure iptables chain creation is idempotent
Concurrent use of the `portmap` and `firewall` plugins can result in
errors during iptables chain creation:

- The `portmap` plugin has a time-of-check-time-of-use race where it
  checks for existence of the chain but the operation isn't atomic.
- The `firewall` plugin doesn't check for existing chains and just
  returns an error.

This commit makes both operations idempotent by creating the chain and
then discarding the error if it's caused by the chain already
existing. It also factors the chain creation out into `pkg/utils` as a
site for future refactoring work.

Signed-off-by: Tim Gross <tim@0x74696d.com>
2019-11-11 10:00:11 -05:00
..
buildversion plugins: correctly output build version, cosmetic cleanups 2019-04-15 16:52:07 +02:00
hwaddr build: some small improvements; bump to go1.10 2018-04-12 16:59:51 +02:00
sysctl Add 'pkg/' from commit 'a11be4d7596203874b742b6597caf255204c56c3' 2017-05-19 19:43:02 +02:00
iptables_test.go ensure iptables chain creation is idempotent 2019-11-11 10:00:11 -05:00
iptables.go ensure iptables chain creation is idempotent 2019-11-11 10:00:11 -05:00
utils_suite_test.go build: some small improvements; bump to go1.10 2018-04-12 16:59:51 +02:00
utils_test.go pkg/meta/bandwidth: increase IfbDeviceName size 2019-07-18 11:45:38 -07:00
utils.go pkg/meta/bandwidth: increase IfbDeviceName size 2019-07-18 11:45:38 -07:00