Selaa lähdekoodia

libnetwork/iptables: remove ErrIptablesNotFound

looks like this error was added in 1cbdaebaa1c2326e57945333420d25d6f77011d5,
and later moved to libnetwork in https://github.com/moby/libnetwork/commit/44c96449c2aafbb22487086ad94ff865f9ee855a
which also updated the description to something that doesn't match what
it means.

In either case, this error was never used as a special / sentinel error,
so we can just use a regular error return.

While at it, I also lower-cased the error-message; it's not string-matched
anywhere, so we can update it to make linters more happy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 vuotta sitten
vanhempi
commit
afe8d3076f
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      libnetwork/iptables/iptables.go

+ 2 - 4
libnetwork/iptables/iptables.go

@@ -60,9 +60,7 @@ var (
 	xLockWaitMsg  = "Another app is currently holding the xtables lock"
 	// used to lock iptables commands if xtables lock is not supported
 	bestEffortLock sync.Mutex
-	// ErrIptablesNotFound is returned when the rule is not found.
-	ErrIptablesNotFound = errors.New("Iptables not found")
-	initOnce            sync.Once
+	initOnce       sync.Once
 )
 
 // IPTable defines struct with IPVersion
@@ -133,7 +131,7 @@ func initCheck() error {
 	initOnce.Do(initDependencies)
 
 	if iptablesPath == "" {
-		return ErrIptablesNotFound
+		return errors.New("iptables not found")
 	}
 	return nil
 }