From 5052f3aed0d8d975bf7745f73141ef96e86862a0 Mon Sep 17 00:00:00 2001 From: m1093782566 Date: Fri, 22 Dec 2017 13:49:47 +0800 Subject: [PATCH] add error string reference --- pkg/util/ipset/ipset.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/util/ipset/ipset.go b/pkg/util/ipset/ipset.go index 56993c26305..7ae28050097 100644 --- a/pkg/util/ipset/ipset.go +++ b/pkg/util/ipset/ipset.go @@ -329,10 +329,13 @@ func IsNotFoundError(err error) bool { es := err.Error() if strings.Contains(es, "does not exist") { // set with the same name already exists + // xref: https://github.com/Olipro/ipset/blob/master/lib/errcode.c#L32-L33 return true } if strings.Contains(es, "element is missing") { // entry is missing from the set + // xref: https://github.com/Olipro/ipset/blob/master/lib/parse.c#L1904 + // https://github.com/Olipro/ipset/blob/master/lib/parse.c#L1925 return true } return false