mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
commit
3978219c14
6 changed files with 7 additions and 7 deletions
|
@ -22,7 +22,7 @@ type NetworkCli struct {
|
||||||
call CallFunc
|
call CallFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNetworkCli is a conveninent function to create a NetworkCli object
|
// NewNetworkCli is a convenient function to create a NetworkCli object
|
||||||
func NewNetworkCli(out, err io.Writer, call CallFunc) *NetworkCli {
|
func NewNetworkCli(out, err io.Writer, call CallFunc) *NetworkCli {
|
||||||
return &NetworkCli{
|
return &NetworkCli{
|
||||||
out: out,
|
out: out,
|
||||||
|
|
|
@ -160,7 +160,7 @@ func TestClientNetworkCreateHelp(t *testing.T) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Docker flag processing in flag.go uses os.Exit(1) for incorrect paramater case.
|
// Docker flag processing in flag.go uses os.Exit(1) for incorrect parameter case.
|
||||||
// TODO : Handle the missing argument case in the IT when CLI is available
|
// TODO : Handle the missing argument case in the IT when CLI is available
|
||||||
/*
|
/*
|
||||||
func TestClientNetworkCreateMissingArgument(t *testing.T) {
|
func TestClientNetworkCreateMissingArgument(t *testing.T) {
|
||||||
|
|
|
@ -279,7 +279,7 @@ func (d *driver) CreateNetwork(id types.UUID, option map[string]interface{}) err
|
||||||
// Even if a bridge exists try to setup IPv4.
|
// Even if a bridge exists try to setup IPv4.
|
||||||
bridgeSetup.queueStep(setupBridgeIPv4)
|
bridgeSetup.queueStep(setupBridgeIPv4)
|
||||||
|
|
||||||
// Conditionnally queue setup steps depending on configuration values.
|
// Conditionally queue setup steps depending on configuration values.
|
||||||
for _, step := range []struct {
|
for _, step := range []struct {
|
||||||
Condition bool
|
Condition bool
|
||||||
Fn setupStep
|
Fn setupStep
|
||||||
|
|
|
@ -59,7 +59,7 @@ func (uat ErrUnsupportedAddressType) Error() string {
|
||||||
return fmt.Sprintf("unsupported address type: %s", string(uat))
|
return fmt.Sprintf("unsupported address type: %s", string(uat))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrInvalidAddressBinding is returned when the host address specfied in the port binding is not valid.
|
// ErrInvalidAddressBinding is returned when the host address specified in the port binding is not valid.
|
||||||
type ErrInvalidAddressBinding string
|
type ErrInvalidAddressBinding string
|
||||||
|
|
||||||
func (iab ErrInvalidAddressBinding) Error() string {
|
func (iab ErrInvalidAddressBinding) Error() string {
|
||||||
|
|
|
@ -53,7 +53,7 @@ type PortBinding struct {
|
||||||
HostPort uint16
|
HostPort uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
// HostAddr returns the host side tranport address
|
// HostAddr returns the host side transport address
|
||||||
func (p PortBinding) HostAddr() (net.Addr, error) {
|
func (p PortBinding) HostAddr() (net.Addr, error) {
|
||||||
switch p.Proto {
|
switch p.Proto {
|
||||||
case UDP:
|
case UDP:
|
||||||
|
@ -65,7 +65,7 @@ func (p PortBinding) HostAddr() (net.Addr, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerAddr returns the container side tranport address
|
// ContainerAddr returns the container side transport address
|
||||||
func (p PortBinding) ContainerAddr() (net.Addr, error) {
|
func (p PortBinding) ContainerAddr() (net.Addr, error) {
|
||||||
switch p.Proto {
|
switch p.Proto {
|
||||||
case UDP:
|
case UDP:
|
||||||
|
|
|
@ -173,7 +173,7 @@ func (n *networkNamespace) AddInterface(i *Interface) error {
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
// Find the network inteerface identified by the SrcName attribute.
|
// Find the network interface identified by the SrcName attribute.
|
||||||
iface, err := netlink.LinkByName(i.SrcName)
|
iface, err := netlink.LinkByName(i.SrcName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue