Skip to content

Commit 7126ecd

Browse files
committed
Stop referring to requested IP address as "preferred",
since it is an error if that address is unavailable. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
1 parent 141a301 commit 7126ecd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

integration-cli/docker_cli_network_unix_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,15 +1126,15 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectPreferredIP(c *check.C) {
11261126
c.Assert(waitRun("c0"), check.IsNil)
11271127
verifyIPAddresses(c, "c0", "n0", "172.28.99.88", "2001:db8:1234::9988")
11281128

1129-
// connect the container to the second network specifying the preferred ip addresses
1129+
// connect the container to the second network specifying an ip addresses
11301130
dockerCmd(c, "network", "connect", "--ip", "172.30.55.44", "--ip6", "2001:db8:abcd::5544", "n1", "c0")
11311131
verifyIPAddresses(c, "c0", "n1", "172.30.55.44", "2001:db8:abcd::5544")
11321132

11331133
// Stop and restart the container
11341134
dockerCmd(c, "stop", "c0")
11351135
dockerCmd(c, "start", "c0")
11361136

1137-
// verify preferred addresses are applied
1137+
// verify requested addresses are applied
11381138
verifyIPAddresses(c, "c0", "n0", "172.28.99.88", "2001:db8:1234::9988")
11391139
verifyIPAddresses(c, "c0", "n1", "172.30.55.44", "2001:db8:abcd::5544")
11401140

@@ -1145,13 +1145,13 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectPreferredIP(c *check.C) {
11451145

11461146
}
11471147

1148-
func (s *DockerNetworkSuite) TestDockerNetworkUnsupportedPreferredIP(c *check.C) {
1149-
// preferred IP is not supported on predefined networks
1148+
func (s *DockerNetworkSuite) TestDockerNetworkUnsupportedRequiredIP(c *check.C) {
1149+
// requested IP is not supported on predefined networks
11501150
for _, mode := range []string{"none", "host", "bridge", "default"} {
11511151
checkUnsupportedNetworkAndIP(c, mode)
11521152
}
11531153

1154-
// preferred IP is not supported on networks with no user defined subnets
1154+
// requested IP is not supported on networks with no user defined subnets
11551155
dockerCmd(c, "network", "create", "n0")
11561156
assertNwIsAvailable(c, "n0")
11571157

runconfig/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ var (
2929
ErrConflictNetworkPublishPorts = fmt.Errorf("Conflicting options: port publishing and the container type network mode")
3030
// ErrConflictNetworkExposePorts conflict between the expose option and the network mode
3131
ErrConflictNetworkExposePorts = fmt.Errorf("Conflicting options: port exposing and the container type network mode")
32-
// ErrUnsupportedNetworkAndIP conflict between network mode and preferred ip address
32+
// ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address
3333
ErrUnsupportedNetworkAndIP = fmt.Errorf("User specified IP address is supported on user defined networks only")
34-
// ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and preferred ip address
34+
// ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address
3535
ErrUnsupportedNetworkNoSubnetAndIP = fmt.Errorf("User specified IP address is supported only when connecting to networks with user configured subnets")
3636
// ErrUnsupportedNetworkAndAlias conflict between network mode and alias
3737
ErrUnsupportedNetworkAndAlias = fmt.Errorf("Network-scoped alias is supported only for containers in user defined networks")

0 commit comments

Comments
 (0)