Bläddra i källkod

libnet/d/bridge: Remove pointless BadRequestError impl

IPv4AddrNoMatchError and IPv6AddrNoMatchError are currently implementing
BadRequestError. They are returned in two cases, and none are due to a
bad user request:

- When calling daemon's CreateNetwork route, if the bridge's IPv4
  address or none of the bridge's IPv6 addresses match what's requested.
  If that happens, there's a big issue somewhere in libnetwork or the
  kernel.
- When restoring a network, for the same reason. In that case, the
  on-disk state drifted from the interface state.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Albin Kerouanton 1 år sedan
förälder
incheckning
6df4a00bb9
1 ändrade filer med 0 tillägg och 6 borttagningar
  1. 0 6
      libnetwork/drivers/bridge/errors.go

+ 0 - 6
libnetwork/drivers/bridge/errors.go

@@ -245,9 +245,6 @@ func (ipv4 *IPv4AddrNoMatchError) Error() string {
 	return fmt.Sprintf("bridge IPv4 (%s) does not match requested configuration %s", ipv4.IP, ipv4.CfgIP)
 	return fmt.Sprintf("bridge IPv4 (%s) does not match requested configuration %s", ipv4.IP, ipv4.CfgIP)
 }
 }
 
 
-// BadRequest denotes the type of this error
-func (ipv4 *IPv4AddrNoMatchError) BadRequest() {}
-
 // IPv6AddrNoMatchError is returned when the bridge's IPv6 address does not match configured.
 // IPv6AddrNoMatchError is returned when the bridge's IPv6 address does not match configured.
 type IPv6AddrNoMatchError net.IPNet
 type IPv6AddrNoMatchError net.IPNet
 
 
@@ -255,9 +252,6 @@ func (ipv6 *IPv6AddrNoMatchError) Error() string {
 	return fmt.Sprintf("bridge IPv6 addresses do not match the expected bridge configuration %s", (*net.IPNet)(ipv6).String())
 	return fmt.Sprintf("bridge IPv6 addresses do not match the expected bridge configuration %s", (*net.IPNet)(ipv6).String())
 }
 }
 
 
-// BadRequest denotes the type of this error
-func (ipv6 *IPv6AddrNoMatchError) BadRequest() {}
-
 // InvalidLinkIPAddrError is returned when a link is configured to a container with an invalid ip address
 // InvalidLinkIPAddrError is returned when a link is configured to a container with an invalid ip address
 type InvalidLinkIPAddrError string
 type InvalidLinkIPAddrError string