mirror of
https://github.com/moby/moby.git
synced 2026-08-09 17:39:58 +00:00
Merge pull request #49350 from thaJeztah/windows_clean_errors
libnetwork/drivers/windows: remove ErrUnsupportedAddressType
This commit is contained in:
@@ -15,16 +15,7 @@ import (
|
||||
"github.com/ishidawataru/sctp"
|
||||
)
|
||||
|
||||
const (
|
||||
maxAllocatePortAttempts = 10
|
||||
)
|
||||
|
||||
// ErrUnsupportedAddressType is returned when the specified address type is not supported.
|
||||
type ErrUnsupportedAddressType string
|
||||
|
||||
func (uat ErrUnsupportedAddressType) Error() string {
|
||||
return fmt.Sprintf("unsupported address type: %s", string(uat))
|
||||
}
|
||||
const maxAllocatePortAttempts = 10
|
||||
|
||||
// AllocatePorts allocates ports specified in bindings from the portMapper
|
||||
func AllocatePorts(portMapper *portmapper.PortMapper, bindings []types.PortBinding, containerIP net.IP) ([]types.PortBinding, error) {
|
||||
@@ -98,7 +89,7 @@ func allocatePort(portMapper *portmapper.PortMapper, bnd *types.PortBinding, con
|
||||
break
|
||||
default:
|
||||
// For completeness
|
||||
return ErrUnsupportedAddressType(fmt.Sprintf("%T", netAddr))
|
||||
return fmt.Errorf("unsupported address type: %T", netAddr)
|
||||
}
|
||||
// Windows does not support host port ranges.
|
||||
bnd.HostPortEnd = bnd.HostPort
|
||||
|
||||
Reference in New Issue
Block a user