commit a5f18ede385f8f348d876635c8483640d6446d65 Author: Michael Cambria Date: Mon Jun 24 16:11:51 2019 -0400 Remove iptables mode dependent existsErr code work-around. iptables fixed in iptables-1.8.1 commit c19fa5833a0bc0eb787799634bd26dea91fcdca1 diff -up plugins-fe60fcddb897079746ec1523fd1837ab05b1e689/vendor/github.com/coreos/go-iptables/iptables/iptables.go.orig plugins-fe60fcddb897079746ec1523fd1837ab05b1e689/vendor/github.com/coreos/go-iptables/iptables/iptables.go --- plugins-fe60fcddb897079746ec1523fd1837ab05b1e689/vendor/github.com/coreos/go-iptables/iptables/iptables.go.orig 2019-05-29 18:30:15.000000000 +0200 +++ plugins-fe60fcddb897079746ec1523fd1837ab05b1e689/vendor/github.com/coreos/go-iptables/iptables/iptables.go 2019-07-31 09:24:30.070738570 +0200 @@ -302,18 +302,13 @@ func (ipt *IPTables) NewChain(table, cha return ipt.run("-t", table, "-N", chain) } +const existsErr = 1 + // ClearChain flushed (deletes all rules) in the specified table/chain. // If the chain does not exist, a new one will be created func (ipt *IPTables) ClearChain(table, chain string) error { err := ipt.NewChain(table, chain) - // the exit code for "this table already exists" is different for - // different iptables modes - existsErr := 1 - if ipt.mode == "nf_tables" { - existsErr = 4 - } - eerr, eok := err.(*Error) switch { case err == nil: