From 2388222e98462fdbbe44f3e091b2b79d80956a9a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 24 Jun 2019 21:29:31 +0200 Subject: update dependencies Ran a `go get -u` and bumped K8s deps to 1.15.0. Signed-off-by: Valentin Rothberg --- vendor/github.com/coreos/go-iptables/iptables/iptables.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/coreos/go-iptables') diff --git a/vendor/github.com/coreos/go-iptables/iptables/iptables.go b/vendor/github.com/coreos/go-iptables/iptables/iptables.go index 8db2597a4..9601bc78a 100644 --- a/vendor/github.com/coreos/go-iptables/iptables/iptables.go +++ b/vendor/github.com/coreos/go-iptables/iptables/iptables.go @@ -31,6 +31,7 @@ type Error struct { exec.ExitError cmd exec.Cmd msg string + proto Protocol exitStatus *int //for overriding } @@ -48,8 +49,8 @@ func (e *Error) Error() string { // IsNotExist returns true if the error is due to the chain or rule not existing func (e *Error) IsNotExist() bool { return e.ExitStatus() == 1 && - (e.msg == "iptables: Bad rule (does a matching rule exist in that chain?).\n" || - e.msg == "iptables: No chain/target/match by that name.\n") + (e.msg == fmt.Sprintf("%s: Bad rule (does a matching rule exist in that chain?).\n", getIptablesCommand(e.proto)) || + e.msg == fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(e.proto))) } // Protocol to differentiate between IPv4 and IPv6 @@ -282,7 +283,8 @@ func (ipt *IPTables) executeList(args []string) ([]string, error) { v := 1 return nil, &Error{ cmd: exec.Cmd{Args: args}, - msg: "iptables: No chain/target/match by that name.", + msg: fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(ipt.proto)), + proto: ipt.proto, exitStatus: &v, } } @@ -385,7 +387,7 @@ func (ipt *IPTables) runWithOutput(args []string, stdout io.Writer) error { if err := cmd.Run(); err != nil { switch e := err.(type) { case *exec.ExitError: - return &Error{*e, cmd, stderr.String(), nil} + return &Error{*e, cmd, stderr.String(), ipt.proto, nil} default: return err } -- cgit v1.2.3-54-g00ecf