libnetwork/drivers/bridge: remove IPv4AddrNoMatchError

It's a generic error, doesn't implement an errdefs type, and not used as
sentinel error anywhere.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-01-28 13:26:55 +01:00
parent 0c1b660048
commit 2f42aa0e26
2 changed files with 1 additions and 12 deletions

View File

@@ -4,7 +4,6 @@ package bridge
import (
"fmt"
"net"
)
// ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not valid.
@@ -70,13 +69,3 @@ func (ndbee NonDefaultBridgeExistError) Error() string {
// Forbidden denotes the type of this error
func (ndbee NonDefaultBridgeExistError) Forbidden() {}
// IPv4AddrNoMatchError is returned when the bridge's IPv4 address does not match configured.
type IPv4AddrNoMatchError struct {
IP net.IP
CfgIP net.IP
}
func (ipv4 *IPv4AddrNoMatchError) Error() string {
return fmt.Sprintf("bridge IPv4 (%s) does not match requested configuration %s", ipv4.IP, ipv4.CfgIP)
}

View File

@@ -27,7 +27,7 @@ func setupVerifyAndReconcileIPv4(config *networkConfiguration, i *bridgeInterfac
// Verify that the bridge IPv4 address matches the requested configuration.
if config.AddressIPv4 != nil && !addrv4.IP.Equal(config.AddressIPv4.IP) {
return &IPv4AddrNoMatchError{IP: addrv4.IP, CfgIP: config.AddressIPv4.IP}
return fmt.Errorf("bridge IPv4 (%s) does not match requested configuration %s", addrv4.IP, config.AddressIPv4.IP)
}
return nil