Remove CLI specific information for API error messages. Issue #17147
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com> Upstream-commit: 74900edbf867e6ffe4e824a8c6383eb34a658341 Component: engine
This commit is contained in:
committed by
Karol Duleba
parent
0a4f515b90
commit
c9f2f55bc6
@@ -3384,17 +3384,17 @@ func (s *DockerSuite) TestRunContainerNetModeWithDnsMacHosts(c *check.C) {
|
||||
}
|
||||
|
||||
out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Conflicting options: --dns and the network mode") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkAndDNS.Error()) {
|
||||
c.Fatalf("run --net=container with --dns should error out")
|
||||
}
|
||||
|
||||
out, _, err = dockerCmdWithError("run", "--mac-address", "92:d0:c6:0a:29:33", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "--mac-address and the network mode") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictContainerNetworkAndMac.Error()) {
|
||||
c.Fatalf("run --net=container with --mac-address should error out")
|
||||
}
|
||||
|
||||
out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "--add-host and the network mode") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkHosts.Error()) {
|
||||
c.Fatalf("run --net=container with --add-host should error out")
|
||||
}
|
||||
}
|
||||
@@ -3405,17 +3405,17 @@ func (s *DockerSuite) TestRunContainerNetModeWithExposePort(c *check.C) {
|
||||
dockerCmd(c, "run", "-d", "--name", "parent", "busybox", "top")
|
||||
|
||||
out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
|
||||
c.Fatalf("run --net=container with -p should error out")
|
||||
}
|
||||
|
||||
out, _, err = dockerCmdWithError("run", "-P", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
|
||||
c.Fatalf("run --net=container with -P should error out")
|
||||
}
|
||||
|
||||
out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Conflicting options: --expose and the network mode (--net)") {
|
||||
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkExposePorts.Error()) {
|
||||
c.Fatalf("run --net=container with --expose should error out")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user