From 77261b5e42d9fdb216a52d52e968de4e101f20d6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 28 Jan 2025 13:07:41 +0100 Subject: [PATCH] libnetwork/drivers/bridge: remove "InternalError()" method from errors The `InternalError()` method was added in [moby/libnetwork@50964c9] to classify the error. However, the same commit defined interfaces for error types (in the types package). The [InternalError] interface defined did not match, as it defines a `Internal()` method instead of `InternalError()`. In short; these errors were never matching any interface, and the actual error implementations themselves were also never used as a sentinel error, so we can safely remove these methods. [moby/libnetwork@50964c9]: https://github.com/moby/libnetwork/commit/50964c994831c3a960d306ff130ff42983e2fe4a [InternalError]: https://github.com/moby/libnetwork/blob/50964c994831c3a960d306ff130ff42983e2fe4a/types/types.go#L233-L237 Signed-off-by: Sebastiaan van Stijn --- libnetwork/drivers/bridge/errors.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libnetwork/drivers/bridge/errors.go b/libnetwork/drivers/bridge/errors.go index 07e3911a56..dfee32c0e1 100644 --- a/libnetwork/drivers/bridge/errors.go +++ b/libnetwork/drivers/bridge/errors.go @@ -14,9 +14,6 @@ func (enip *ErrNoIPAddr) Error() string { return "bridge has no IPv4 address configured" } -// InternalError denotes the type of this error -func (enip *ErrNoIPAddr) InternalError() {} - // ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not valid. type ErrInvalidGateway struct{} @@ -91,9 +88,6 @@ func (ipv4 *IPv4AddrAddError) Error() string { return fmt.Sprintf("failed to add IPv4 address %s to bridge: %v", ipv4.IP, ipv4.Err) } -// InternalError denotes the type of this error -func (ipv4 *IPv4AddrAddError) InternalError() {} - // IPv4AddrNoMatchError is returned when the bridge's IPv4 address does not match configured. type IPv4AddrNoMatchError struct { IP net.IP