Browse code

Remove a redundant funtion and fix some typos

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

Yanqiang Miao authored on 2016/11/30 16:16:07
Showing 1 changed files
... ...
@@ -2,45 +2,37 @@ package runconfig
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-
6
-	"github.com/docker/docker/api/errors"
7 5
 )
8 6
 
9 7
 var (
10 8
 	// ErrConflictContainerNetworkAndLinks conflict between --net=container and links
11
-	ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: container type network can't be used with links. This would result in undefined behavior")
12
-	// ErrConflictUserDefinedNetworkAndLinks conflict between --net=<NETWORK> and links
13
-	ErrConflictUserDefinedNetworkAndLinks = fmt.Errorf("Conflicting options: networking can't be used with links. This would result in undefined behavior")
9
+	ErrConflictContainerNetworkAndLinks = fmt.Errorf("conflicting options: container type network can't be used with links. This would result in undefined behavior")
14 10
 	// ErrConflictSharedNetwork conflict between private and other networks
15
-	ErrConflictSharedNetwork = fmt.Errorf("Container sharing network namespace with another container or host cannot be connected to any other network")
11
+	ErrConflictSharedNetwork = fmt.Errorf("container sharing network namespace with another container or host cannot be connected to any other network")
16 12
 	// ErrConflictHostNetwork conflict from being disconnected from host network or connected to host network.
17
-	ErrConflictHostNetwork = fmt.Errorf("Container cannot be disconnected from host network or connected to host network")
13
+	ErrConflictHostNetwork = fmt.Errorf("container cannot be disconnected from host network or connected to host network")
18 14
 	// ErrConflictNoNetwork conflict between private and other networks
19
-	ErrConflictNoNetwork = fmt.Errorf("Container cannot be connected to multiple networks with one of the networks in private (none) mode")
15
+	ErrConflictNoNetwork = fmt.Errorf("container cannot be connected to multiple networks with one of the networks in private (none) mode")
20 16
 	// ErrConflictNetworkAndDNS conflict between --dns and the network mode
21
-	ErrConflictNetworkAndDNS = fmt.Errorf("Conflicting options: dns and the network mode")
17
+	ErrConflictNetworkAndDNS = fmt.Errorf("conflicting options: dns and the network mode")
22 18
 	// ErrConflictNetworkHostname conflict between the hostname and the network mode
23
-	ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: hostname and the network mode")
19
+	ErrConflictNetworkHostname = fmt.Errorf("conflicting options: hostname and the network mode")
24 20
 	// ErrConflictHostNetworkAndLinks conflict between --net=host and links
25
-	ErrConflictHostNetworkAndLinks = fmt.Errorf("Conflicting options: host type networking can't be used with links. This would result in undefined behavior")
21
+	ErrConflictHostNetworkAndLinks = fmt.Errorf("conflicting options: host type networking can't be used with links. This would result in undefined behavior")
26 22
 	// ErrConflictContainerNetworkAndMac conflict between the mac address and the network mode
27
-	ErrConflictContainerNetworkAndMac = fmt.Errorf("Conflicting options: mac-address and the network mode")
23
+	ErrConflictContainerNetworkAndMac = fmt.Errorf("conflicting options: mac-address and the network mode")
28 24
 	// ErrConflictNetworkHosts conflict between add-host and the network mode
29
-	ErrConflictNetworkHosts = fmt.Errorf("Conflicting options: custom host-to-IP mapping and the network mode")
25
+	ErrConflictNetworkHosts = fmt.Errorf("conflicting options: custom host-to-IP mapping and the network mode")
30 26
 	// ErrConflictNetworkPublishPorts conflict between the publish options and the network mode
31
-	ErrConflictNetworkPublishPorts = fmt.Errorf("Conflicting options: port publishing and the container type network mode")
27
+	ErrConflictNetworkPublishPorts = fmt.Errorf("conflicting options: port publishing and the container type network mode")
32 28
 	// ErrConflictNetworkExposePorts conflict between the expose option and the network mode
33
-	ErrConflictNetworkExposePorts = fmt.Errorf("Conflicting options: port exposing and the container type network mode")
29
+	ErrConflictNetworkExposePorts = fmt.Errorf("conflicting options: port exposing and the container type network mode")
34 30
 	// ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address
35
-	ErrUnsupportedNetworkAndIP = fmt.Errorf("User specified IP address is supported on user defined networks only")
31
+	ErrUnsupportedNetworkAndIP = fmt.Errorf("user specified IP address is supported on user defined networks only")
36 32
 	// ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address
37
-	ErrUnsupportedNetworkNoSubnetAndIP = fmt.Errorf("User specified IP address is supported only when connecting to networks with user configured subnets")
33
+	ErrUnsupportedNetworkNoSubnetAndIP = fmt.Errorf("user specified IP address is supported only when connecting to networks with user configured subnets")
38 34
 	// ErrUnsupportedNetworkAndAlias conflict between network mode and alias
39
-	ErrUnsupportedNetworkAndAlias = fmt.Errorf("Network-scoped alias is supported only for containers in user defined networks")
35
+	ErrUnsupportedNetworkAndAlias = fmt.Errorf("network-scoped alias is supported only for containers in user defined networks")
40 36
 	// ErrConflictUTSHostname conflict between the hostname and the UTS mode
41
-	ErrConflictUTSHostname = fmt.Errorf("Conflicting options: hostname and the UTS mode")
37
+	ErrConflictUTSHostname = fmt.Errorf("conflicting options: hostname and the UTS mode")
42 38
 )
43
-
44
-func conflictError(err error) error {
45
-	return errors.NewRequestConflictError(err)
46
-}