Browse Source

libnet/d/bridge: Remove unused error types

These error types are removed:

- ErrInvalidContainerConfig
- ErrInvalidPort
- ErrInvalidAddressBinding
- InvalidSandboxIDError
- IPv4AddrRangeError

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Albin Kerouanton 1 year ago
parent
commit
03db2f8c3d
1 changed files with 0 additions and 51 deletions
  1. 0 51
      libnetwork/drivers/bridge/errors.go

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

@@ -37,16 +37,6 @@ func (einc *ErrInvalidNetworkConfig) Error() string {
 // Forbidden denotes the type of this error
 func (einc *ErrInvalidNetworkConfig) Forbidden() {}
 
-// ErrInvalidContainerConfig error is returned when an endpoint create is attempted with an invalid configuration.
-type ErrInvalidContainerConfig struct{}
-
-func (eicc *ErrInvalidContainerConfig) Error() string {
-	return "Error in joining a container due to invalid configuration"
-}
-
-// BadRequest denotes the type of this error
-func (eicc *ErrInvalidContainerConfig) BadRequest() {}
-
 // ErrInvalidEndpointConfig error is returned when an endpoint create is attempted with an invalid endpoint configuration.
 type ErrInvalidEndpointConfig struct{}
 
@@ -117,16 +107,6 @@ func (eim ErrInvalidMtu) Error() string {
 // BadRequest denotes the type of this error
 func (eim ErrInvalidMtu) BadRequest() {}
 
-// ErrInvalidPort is returned when the container or host port specified in the port binding is not valid.
-type ErrInvalidPort string
-
-func (ip ErrInvalidPort) Error() string {
-	return fmt.Sprintf("invalid transport port: %s", string(ip))
-}
-
-// BadRequest denotes the type of this error
-func (ip ErrInvalidPort) BadRequest() {}
-
 // ErrUnsupportedAddressType is returned when the specified address type is not supported.
 type ErrUnsupportedAddressType string
 
@@ -137,16 +117,6 @@ func (uat ErrUnsupportedAddressType) Error() string {
 // BadRequest denotes the type of this error
 func (uat ErrUnsupportedAddressType) BadRequest() {}
 
-// ErrInvalidAddressBinding is returned when the host address specified in the port binding is not valid.
-type ErrInvalidAddressBinding string
-
-func (iab ErrInvalidAddressBinding) Error() string {
-	return fmt.Sprintf("invalid host address in port binding: %s", string(iab))
-}
-
-// BadRequest denotes the type of this error
-func (iab ErrInvalidAddressBinding) BadRequest() {}
-
 // ActiveEndpointsError is returned when there are
 // still active endpoints in the network being deleted.
 type ActiveEndpointsError string
@@ -180,17 +150,6 @@ func (ieie InvalidEndpointIDError) Error() string {
 // BadRequest denotes the type of this error
 func (ieie InvalidEndpointIDError) BadRequest() {}
 
-// InvalidSandboxIDError is returned when the passed
-// sandbox id is not valid.
-type InvalidSandboxIDError string
-
-func (isie InvalidSandboxIDError) Error() string {
-	return fmt.Sprintf("invalid sandbox id: %s", string(isie))
-}
-
-// BadRequest denotes the type of this error
-func (isie InvalidSandboxIDError) BadRequest() {}
-
 // EndpointNotFoundError is returned when the no endpoint
 // with the passed endpoint id is found.
 type EndpointNotFoundError string
@@ -273,16 +232,6 @@ func (action InvalidIPTablesCfgError) Error() string {
 // BadRequest denotes the type of this error
 func (action InvalidIPTablesCfgError) BadRequest() {}
 
-// IPv4AddrRangeError is returned when a valid IP address range couldn't be found.
-type IPv4AddrRangeError string
-
-func (name IPv4AddrRangeError) Error() string {
-	return fmt.Sprintf("can't find an address range for interface %q", string(name))
-}
-
-// BadRequest denotes the type of this error
-func (name IPv4AddrRangeError) BadRequest() {}
-
 // IPv4AddrAddError is returned when IPv4 address could not be added to the bridge.
 type IPv4AddrAddError struct {
 	IP  *net.IPNet