libnetwork/drivers/bridge: remove ErrNoIPAddr

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:21:27 +01:00
parent 77261b5e42
commit dc52ecb1d0
2 changed files with 2 additions and 8 deletions

View File

@@ -7,13 +7,6 @@ import (
"net"
)
// ErrNoIPAddr error is returned when bridge has no IPv4 address configured.
type ErrNoIPAddr struct{}
func (enip *ErrNoIPAddr) Error() string {
return "bridge has no IPv4 address configured"
}
// ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not valid.
type ErrInvalidGateway struct{}

View File

@@ -1,6 +1,7 @@
package bridge
import (
"errors"
"fmt"
"strings"
@@ -21,7 +22,7 @@ func setupVerifyAndReconcileIPv4(config *networkConfiguration, i *bridgeInterfac
// Verify that the bridge has an IPv4 address.
if addrv4.IPNet == nil {
return &ErrNoIPAddr{}
return errors.New("bridge has no IPv4 address configured")
}
// Verify that the bridge IPv4 address matches the requested configuration.